pub struct AnimationClip { /* private fields */ }Expand description
Immutable named clip. Share with Arc between independent players.
Implementations§
Source§impl AnimationClip
impl AnimationClip
Sourcepub fn new(
name: impl Into<String>,
frames: Vec<SpriteFrame>,
mode: PlaybackMode,
) -> Result<Self, SpriteError>
pub fn new( name: impl Into<String>, frames: Vec<SpriteFrame>, mode: PlaybackMode, ) -> Result<Self, SpriteError>
Validates a nonblank name, at least one frame, positive durations and a representable total duration. Texture bounds are checked when drawn.
Sourcepub fn frames(&self) -> &[SpriteFrame]
pub fn frames(&self) -> &[SpriteFrame]
Ordered frames and their individual durations.
Sourcepub fn mode(&self) -> PlaybackMode
pub fn mode(&self) -> PlaybackMode
Behavior at the clip’s end.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnimationClip
impl RefUnwindSafe for AnimationClip
impl Send for AnimationClip
impl Sync for AnimationClip
impl Unpin for AnimationClip
impl UnsafeUnpin for AnimationClip
impl UnwindSafe for AnimationClip
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