pub struct Timeline { /* private fields */ }Expand description
A Timeline is a sequence of Acts that play in order.
Implementations§
Source§impl Timeline
impl Timeline
Sourcepub fn loop_forever(self) -> Self
pub fn loop_forever(self) -> Self
Set the timeline to loop from the beginning.
Sourcepub fn loop_from(self, act_name: impl Into<String>) -> Self
pub fn loop_from(self, act_name: impl Into<String>) -> Self
Set the timeline to loop starting from a specific act.
Sourcepub fn on_loop<F: Fn(u32) + 'static>(self, callback: F) -> Self
pub fn on_loop<F: Fn(u32) + 'static>(self, callback: F) -> Self
Set a callback to fire when the timeline loops.
The callback receives the loop iteration count (1 for first loop, 2 for second, etc.).
Sourcepub fn on_act_enter<F: Fn(&str) + 'static>(self, callback: F) -> Self
pub fn on_act_enter<F: Fn(&str) + 'static>(self, callback: F) -> Self
Set a callback to fire when any act is entered.
The callback receives the act name.
Sourcepub fn on_act_exit<F: Fn(&str) + 'static>(self, callback: F) -> Self
pub fn on_act_exit<F: Fn(&str) + 'static>(self, callback: F) -> Self
Set a callback to fire when any act is exited.
The callback receives the act name.
Sourcepub fn at(&self, time: f64) -> TimelineState<'_>
pub fn at(&self, time: f64) -> TimelineState<'_>
Query the timeline state at a specific time.
Sourcepub fn start(&self) -> PlayingTimeline
pub fn start(&self) -> PlayingTimeline
Create a playing timeline instance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timeline
impl !RefUnwindSafe for Timeline
impl !Send for Timeline
impl !Sync for Timeline
impl Unpin for Timeline
impl !UnwindSafe for Timeline
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