pub struct AnimationInfo {
pub rate_func: fn(f64) -> f64,
pub start_sec: f64,
pub duration_secs: f64,
pub enabled: bool,
}Expand description
Info of an animation.
When AnimationInfo::enabled is false, the animation will not be evaluated.
Fields§
§rate_func: fn(f64) -> f64The rate function used for evaluating, default value: linear
start_sec: f64Start sec, default value: 0.0
duration_secs: f64The duration seconds, default value: 1.0
enabled: boolIs enabled, default value: true
Implementations§
Source§impl AnimationInfo
impl AnimationInfo
Sourcepub fn range_inclusive(&self) -> RangeInclusive<f64>
pub fn range_inclusive(&self) -> RangeInclusive<f64>
Get the inclusive range of the animation
Sourcepub fn map_sec_to_alpha(&self, sec: f64) -> Option<f64>
pub fn map_sec_to_alpha(&self, sec: f64) -> Option<f64>
Map the global sec to outer alpha
note that this uses a range_inclusive
Source§impl AnimationInfo
impl AnimationInfo
Sourcepub fn at(self, at_sec: f64) -> Self
pub fn at(self, at_sec: f64) -> Self
A builder func to modify AnimationInfo::start_sec
Sourcepub fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Self
pub fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Self
A builder func to modify AnimationInfo::rate_func
Sourcepub fn with_duration(self, secs: f64) -> Self
pub fn with_duration(self, secs: f64) -> Self
A builder func to modify AnimationInfo::duration_secs
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
A builder func to modify AnimationInfo::enabled
Trait Implementations§
Source§impl Clone for AnimationInfo
impl Clone for AnimationInfo
Source§fn clone(&self) -> AnimationInfo
fn clone(&self) -> AnimationInfo
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnimationInfo
impl Debug for AnimationInfo
Auto Trait Implementations§
impl Freeze for AnimationInfo
impl RefUnwindSafe for AnimationInfo
impl Send for AnimationInfo
impl Sync for AnimationInfo
impl Unpin for AnimationInfo
impl UnwindSafe for AnimationInfo
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> StaticAnim for Twhere
T: StaticAnimRequirement + 'static,
impl<T> StaticAnim for Twhere
T: StaticAnimRequirement + 'static,
Source§fn show(&self) -> AnimationCell<T>
fn show(&self) -> AnimationCell<T>
Show the item
Source§fn hide(&self) -> AnimationCell<T>
fn hide(&self) -> AnimationCell<T>
Hide the item