pub struct MultiKeyframeAnimation { /* private fields */ }Expand description
Multi-property keyframe animation
Implementations§
Source§impl MultiKeyframeAnimation
impl MultiKeyframeAnimation
Sourcepub fn keyframe(
self,
time: f32,
properties: KeyframeProperties,
easing: Easing,
) -> Self
pub fn keyframe( self, time: f32, properties: KeyframeProperties, easing: Easing, ) -> Self
Add a keyframe to the animation (builder pattern)
Sourcepub fn direction(self, direction: PlayDirection) -> Self
pub fn direction(self, direction: PlayDirection) -> Self
Set playback direction
Sourcepub fn iterations(self, count: i32) -> Self
pub fn iterations(self, count: i32) -> Self
Set number of iterations (-1 for infinite)
Sourcepub fn set_direction(&mut self, direction: PlayDirection)
pub fn set_direction(&mut self, direction: PlayDirection)
Set playback direction (mutating)
Sourcepub fn set_fill_mode(&mut self, fill_mode: FillMode)
pub fn set_fill_mode(&mut self, fill_mode: FillMode)
Set fill mode (mutating)
Sourcepub fn set_iterations(&mut self, count: i32)
pub fn set_iterations(&mut self, count: i32)
Set number of iterations (mutating, -1 for infinite)
Sourcepub fn set_reversed(&mut self, reversed: bool)
pub fn set_reversed(&mut self, reversed: bool)
Set reversed state (mutating)
When true, animation plays in reverse direction for the current iteration. Used internally for Alternate direction and for AlternateReverse start.
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Check if the animation is currently playing
Sourcepub fn current_properties(&self) -> KeyframeProperties
pub fn current_properties(&self) -> KeyframeProperties
Get the current interpolated properties
Sourcepub fn duration_ms(&self) -> u32
pub fn duration_ms(&self) -> u32
Get the duration in milliseconds
Sourcepub fn total_duration_ms(&self) -> u32
pub fn total_duration_ms(&self) -> u32
Get total duration including delay
Sourcepub fn first_keyframe(&self) -> Option<&MultiKeyframe>
pub fn first_keyframe(&self) -> Option<&MultiKeyframe>
Get the first keyframe (if any)
Sourcepub fn last_keyframe(&self) -> Option<&MultiKeyframe>
pub fn last_keyframe(&self) -> Option<&MultiKeyframe>
Get the last keyframe (if any)
Sourcepub fn keyframes(&self) -> &[MultiKeyframe]
pub fn keyframes(&self) -> &[MultiKeyframe]
Get all keyframes
Sourcepub fn sample_at(&self, progress: f32) -> KeyframeProperties
pub fn sample_at(&self, progress: f32) -> KeyframeProperties
Sample the animation at a specific progress (0.0 to 1.0)
This is useful for externally-timed animations where you manage the progress yourself rather than using tick().
Trait Implementations§
Source§impl Clone for MultiKeyframeAnimation
impl Clone for MultiKeyframeAnimation
Source§fn clone(&self) -> MultiKeyframeAnimation
fn clone(&self) -> MultiKeyframeAnimation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more