pub struct State { /* private fields */ }
Expand description
Animation state
Implementations
sourceimpl State
impl State
sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset animation state
The animation will restart from the first frame, like if the animation was freshly spawned.
sourcepub fn animation_frame_index(&self) -> usize
pub fn animation_frame_index(&self) -> usize
Returns the index of the current animation frame
The index is relative to the animation sequence. not to the sprite-sheet.
sourcepub fn sprite_frame_index(&self) -> usize
pub fn sprite_frame_index(&self) -> usize
Returns the index of the current sprite frame
The index is relative to the sprite atlas. not to the animation frame sequence.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more