pub struct TimelinePlayer {
pub timeline: Timeline,
pub time: f32,
pub state: PlaybackState,
/* private fields */
}Expand description
Drives a Timeline forward in time and dispatches actions.
Fields§
§timeline: Timeline§time: f32§state: PlaybackStateImplementations§
Source§impl TimelinePlayer
impl TimelinePlayer
pub fn new(timeline: Timeline) -> Self
pub fn play(&mut self)
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn stop(&mut self)
pub fn seek(&mut self, time: f32)
pub fn is_playing(&self) -> bool
pub fn is_finished(&self) -> bool
Sourcepub fn register_callback(
&mut self,
name: impl Into<String>,
f: impl Fn(&HashMap<String, String>) + Send + Sync + 'static,
)
pub fn register_callback( &mut self, name: impl Into<String>, f: impl Fn(&HashMap<String, String>) + Send + Sync + 'static, )
Register a named callback.
Sourcepub fn tick(&mut self, dt: f32) -> Vec<TimelineAction>
pub fn tick(&mut self, dt: f32) -> Vec<TimelineAction>
Advance the timeline by dt seconds and fire pending cues.
Returns a list of actions that fired this tick.
pub fn get_flag(&self, name: &str) -> bool
pub fn set_flag(&mut self, name: impl Into<String>, value: bool)
Auto Trait Implementations§
impl Freeze for TimelinePlayer
impl !RefUnwindSafe for TimelinePlayer
impl Send for TimelinePlayer
impl !Sync for TimelinePlayer
impl Unpin for TimelinePlayer
impl UnsafeUnpin for TimelinePlayer
impl !UnwindSafe for TimelinePlayer
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.