pub struct Animator { /* private fields */ }Expand description
Manages multiple animations.
Implementations§
Source§impl Animator
impl Animator
Sourcepub fn create(&mut self, from: f32, to: f32, duration_ms: u32) -> AnimationId
pub fn create(&mut self, from: f32, to: f32, duration_ms: u32) -> AnimationId
Create a new animation and return its ID.
Sourcepub fn get(&self, id: AnimationId) -> Option<&AnimationInstance>
pub fn get(&self, id: AnimationId) -> Option<&AnimationInstance>
Get an animation by ID.
Sourcepub fn get_mut(&mut self, id: AnimationId) -> Option<&mut AnimationInstance>
pub fn get_mut(&mut self, id: AnimationId) -> Option<&mut AnimationInstance>
Get a mutable animation by ID.
Sourcepub fn start(&mut self, id: AnimationId)
pub fn start(&mut self, id: AnimationId)
Start an animation.
Sourcepub fn pause(&mut self, id: AnimationId)
pub fn pause(&mut self, id: AnimationId)
Pause an animation.
Sourcepub fn resume(&mut self, id: AnimationId)
pub fn resume(&mut self, id: AnimationId)
Resume an animation.
Sourcepub fn stop(&mut self, id: AnimationId)
pub fn stop(&mut self, id: AnimationId)
Stop an animation.
Sourcepub fn remove(&mut self, id: AnimationId)
pub fn remove(&mut self, id: AnimationId)
Remove an animation.
Sourcepub fn value(&self, id: AnimationId) -> Option<f32>
pub fn value(&self, id: AnimationId) -> Option<f32>
Get the value of an animation.
Sourcepub fn cleanup_completed(&mut self)
pub fn cleanup_completed(&mut self)
Remove all completed animations.
Sourcepub fn has_running(&self) -> bool
pub fn has_running(&self) -> bool
Check if any animations are running.
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 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