pub struct AnimationInstance {
pub id: u64,
pub tween: Tween<f32>,
pub state: AnimationState,
pub loop_count: u32,
pub current_loop: u32,
pub alternate: bool,
/* private fields */
}Expand description
An animation instance that can be managed by an Animator.
Fields§
§id: u64Unique ID
tween: Tween<f32>Tween for the animation
state: AnimationStateCurrent state
loop_count: u32Loop count (0 = infinite, 1 = once, N = N times)
current_loop: u32Current loop iteration
alternate: boolWhether to reverse on alternate loops (ping-pong)
Implementations§
Source§impl AnimationInstance
impl AnimationInstance
Sourcepub fn new(id: u64, from: f32, to: f32, duration_ms: u32) -> AnimationInstance
pub fn new(id: u64, from: f32, to: f32, duration_ms: u32) -> AnimationInstance
Create a new animation instance.
Sourcepub const fn with_easing(self, easing: EasingFunction) -> AnimationInstance
pub const fn with_easing(self, easing: EasingFunction) -> AnimationInstance
Set easing function.
Sourcepub const fn with_loop_count(self, count: u32) -> AnimationInstance
pub const fn with_loop_count(self, count: u32) -> AnimationInstance
Set loop count (0 = infinite).
Sourcepub const fn with_alternate(self, alternate: bool) -> AnimationInstance
pub const fn with_alternate(self, alternate: bool) -> AnimationInstance
Enable ping-pong alternating.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnimationInstance
impl RefUnwindSafe for AnimationInstance
impl Send for AnimationInstance
impl Sync for AnimationInstance
impl Unpin for AnimationInstance
impl UnwindSafe for AnimationInstance
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