pub struct Timeline {
pub looping: Loop,
pub time_scale: f32,
/* private fields */
}Expand description
Composes multiple animations on one shared clock.
Entries are stored by label, absolute start time, and cached duration.
Normal one-shot playback advances children incrementally. Seeking and
timeline-level loops resynchronize children through Playable::seek_to.
Fields§
§looping: LoopTimeline-level looping behavior.
time_scale: f32Timeline time scale. 1.0 = normal speed, 2.0 = double speed.
Implementations§
Source§impl Timeline
impl Timeline
Sourcepub fn time_scale(self, scale: f32) -> Timeline
pub fn time_scale(self, scale: f32) -> Timeline
Set the timeline time scale.
Negative values are clamped to 0.0.
Sourcepub fn set_time_scale(&mut self, scale: f32)
pub fn set_time_scale(&mut self, scale: f32)
Change the timeline time scale at runtime.
1.0 is normal speed, 2.0 is double speed, and 0.0 freezes time.
Sourcepub fn on_entry_complete(
self,
label: impl Into<String>,
f: impl FnMut() + Send + 'static,
) -> Timeline
pub fn on_entry_complete( self, label: impl Into<String>, f: impl FnMut() + Send + 'static, ) -> Timeline
Register a callback fired when the labeled entry completes during update.
This is available with the std feature. Seeking and resetting do not
fire callbacks.
Sourcepub fn on_complete(self, f: impl FnMut() + Send + 'static) -> Timeline
pub fn on_complete(self, f: impl FnMut() + Send + 'static) -> Timeline
Register a callback fired once when finite timeline playback completes during update.
This is available with the std feature. Seeking to the end does not
fire this callback.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
true when the timeline has finished all finite playback.
Sourcepub fn state(&self) -> TimelineState
pub fn state(&self) -> TimelineState
Current timeline state.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Number of entries in the timeline.
Trait Implementations§
Source§impl Playable for Timeline
impl Playable for Timeline
Source§fn is_complete(&self) -> bool
fn is_complete(&self) -> bool
true when the animation has reached its terminal state.