pub struct Animation {
pub name: String,
pub frames: Vec<Frame>,
}Expand description
A tagged animation (one state).
Fields§
§name: String§frames: Vec<Frame>Implementations§
Source§impl Animation
impl Animation
pub fn duration_ms(&self) -> u64
Sourcepub fn frame_at(&self, elapsed_ms: u64, looping: bool) -> &Frame
pub fn frame_at(&self, elapsed_ms: u64, looping: bool) -> &Frame
Frame shown elapsed_ms after the state started. Looping animations wrap;
one-shots hold their last frame.
Sourcepub fn frame_index_at(&self, elapsed_ms: u64, looping: bool) -> usize
pub fn frame_index_at(&self, elapsed_ms: u64, looping: bool) -> usize
Index of the frame shown elapsed_ms after the state started.
Trait Implementations§
impl Eq for Animation
impl StructuralPartialEq for Animation
Auto Trait Implementations§
impl Forget for Animation
impl Freeze for Animation
impl Move for Animation
impl RefUnwindSafe for Animation
impl Send for Animation
impl Sync for Animation
impl Unpin for Animation
impl UnsafeUnpin for Animation
impl UnwindSafe for Animation
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