pub struct AnimationManager { /* private fields */ }Expand description
The keyed store of in-flight animations.
Holds only what must outlive a frame.
Implementations§
Source§impl AnimationManager
impl AnimationManager
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether anything is animating (i.e. whether a frame needs scheduling).
Sourcepub fn start_or_retarget_move(
&mut self,
key: AnimKey,
flip: FlipTransform,
mode: InterpolationMode,
)
pub fn start_or_retarget_move( &mut self, key: AnimKey, flip: FlipTransform, mode: InterpolationMode, )
Start a move, or retarget one already in flight under this key.
Sourcepub fn start_enter(
&mut self,
key: AnimKey,
from: (f32, f32),
mode: InterpolationMode,
)
pub fn start_enter( &mut self, key: AnimKey, from: (f32, f32), mode: InterpolationMode, )
Start an enter animation, unless this key is already animating.
Sourcepub fn start_exit(
&mut self,
key: AnimKey,
to: (f32, f32),
mode: InterpolationMode,
)
pub fn start_exit( &mut self, key: AnimKey, to: (f32, f32), mode: InterpolationMode, )
Start an exit animation.
If an animation is already in flight, the channels retarget from their current value with velocity preserved.
Sourcepub fn get_mut(&mut self, key: AnimKey) -> Option<&mut ActiveAnim>
pub fn get_mut(&mut self, key: AnimKey) -> Option<&mut ActiveAnim>
Mutable access to an in-flight animation.
Sourcepub fn get(&self, key: AnimKey) -> Option<&ActiveAnim>
pub fn get(&self, key: AnimKey) -> Option<&ActiveAnim>
Read the current state for a key.
Sourcepub fn iter(&self) -> impl Iterator<Item = (AnimKey, &ActiveAnim)>
pub fn iter(&self) -> impl Iterator<Item = (AnimKey, &ActiveAnim)>
Every in-flight animation with its key.
Sourcepub fn tick(&mut self, dt: f32) -> Vec<AnimKey>
pub fn tick(&mut self, dt: f32) -> Vec<AnimKey>
Advance every animation and drop the ones that arrived.
Returns the keys that finished this tick.
Sourcepub fn cancel(&mut self, key: AnimKey) -> Option<ActiveAnim>
pub fn cancel(&mut self, key: AnimKey) -> Option<ActiveAnim>
Drop an animation without letting it finish.
Trait Implementations§
Source§impl Clone for AnimationManager
impl Clone for AnimationManager
Source§fn clone(&self) -> AnimationManager
fn clone(&self) -> AnimationManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnimationManager
impl Debug for AnimationManager
Source§impl Default for AnimationManager
impl Default for AnimationManager
Source§fn default() -> AnimationManager
fn default() -> AnimationManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AnimationManager
impl RefUnwindSafe for AnimationManager
impl Send for AnimationManager
impl Sync for AnimationManager
impl Unpin for AnimationManager
impl UnsafeUnpin for AnimationManager
impl UnwindSafe for AnimationManager
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