pub struct Animator { /* private fields */ }Expand description
Tracks a set of keyed transitions and advances them frame by frame.
Each animation is identified by a caller-chosen u64 key; starting a new
animation with an existing key replaces it (so a re-triggered hover doesn’t
stack). Animator::advance adds dt seconds to every active animation and
drops the finished ones.
Implementations§
Source§impl Animator
impl Animator
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Number of currently-active animations.
Sourcepub fn is_animating(&self) -> bool
pub fn is_animating(&self) -> bool
Returns true if any animation is in flight.
Sourcepub fn start(&mut self, key: u64, start: f32, end: f32, transition: Transition)
pub fn start(&mut self, key: u64, start: f32, end: f32, transition: Transition)
Start (or restart) the animation under key, interpolating
start → end over transition. Any existing animation with the same
key is replaced and its elapsed time reset.
Sourcepub fn value(&self, key: u64) -> Option<f32>
pub fn value(&self, key: u64) -> Option<f32>
The current value of the animation under key, or None if no such
animation is active.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Animator
impl RefUnwindSafe for Animator
impl Send for Animator
impl Sync for Animator
impl Unpin for Animator
impl UnsafeUnpin for Animator
impl UnwindSafe for Animator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more