pub struct AnimationInstance {
pub id: AnimationId,
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: AnimationIdUnique 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: AnimationId, from: f32, to: f32, duration_ms: u32) -> Self
pub fn new(id: AnimationId, from: f32, to: f32, duration_ms: u32) -> Self
Create a new animation instance.
Sourcepub const fn with_easing(self, easing: EasingFunction) -> Self
pub const fn with_easing(self, easing: EasingFunction) -> Self
Set easing function.
Sourcepub const fn with_loop_count(self, count: u32) -> Self
pub const fn with_loop_count(self, count: u32) -> Self
Set loop count (0 = infinite).
Sourcepub const fn with_alternate(self, alternate: bool) -> Self
pub const fn with_alternate(self, alternate: bool) -> Self
Enable ping-pong alternating.