pub struct SkeletalAnimator {
pub animation: SkeletalAnimation,
pub current_time: f32,
pub playing: bool,
pub speed: f32,
}Expand description
Controls playback of a SkeletalAnimation on an entity.
Attach alongside a Skeleton2D component.
The update_skeletal_animations
system advances the timer and samples keyframes each frame.
Fields§
§animation: SkeletalAnimationThe animation clip being played.
current_time: f32Current playback position in seconds.
playing: boolWhether the animator is actively advancing time.
speed: f32Playback speed multiplier (1.0 = normal).
Implementations§
Source§impl SkeletalAnimator
impl SkeletalAnimator
Sourcepub fn new(animation: SkeletalAnimation) -> SkeletalAnimator
pub fn new(animation: SkeletalAnimation) -> SkeletalAnimator
Creates a new animator for the given animation, starting paused at t=0.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true if a non-looping animation has reached its end.
Trait Implementations§
Source§impl Clone for SkeletalAnimator
impl Clone for SkeletalAnimator
Source§fn clone(&self) -> SkeletalAnimator
fn clone(&self) -> SkeletalAnimator
Returns a duplicate of the value. Read more
1.0.0 · 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 SkeletalAnimator
impl Debug for SkeletalAnimator
impl Component for SkeletalAnimator
Auto Trait Implementations§
impl Freeze for SkeletalAnimator
impl RefUnwindSafe for SkeletalAnimator
impl Send for SkeletalAnimator
impl Sync for SkeletalAnimator
impl Unpin for SkeletalAnimator
impl UnsafeUnpin for SkeletalAnimator
impl UnwindSafe for SkeletalAnimator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more