pub struct TweenSequence<T: Lerp + Clone + Debug> {
pub steps: Vec<SequenceStep<T>>,
pub elapsed: f32,
pub looping: bool,
pub duration: f32,
pub done: bool,
/* private fields */
}Expand description
A sequence of tweens played one after another with optional overlap.
The sequence tracks its own clock and drives one step at a time. The current value is the output of the currently active step.
Fields§
§steps: Vec<SequenceStep<T>>§elapsed: f32§looping: bool§duration: f32§done: boolImplementations§
Source§impl<T: Lerp + Clone + Debug> TweenSequence<T>
impl<T: Lerp + Clone + Debug> TweenSequence<T>
Sourcepub fn new(steps: Vec<(Tween<T>, f32)>, default_val: T, looping: bool) -> Self
pub fn new(steps: Vec<(Tween<T>, f32)>, default_val: T, looping: bool) -> Self
Build a sequence from a list of (tween, overlap) pairs.
Sourcepub fn tick(&mut self, dt: f32) -> T
pub fn tick(&mut self, dt: f32) -> T
Advance the sequence by dt and return the current interpolated value.
Sourcepub fn current_value(&self) -> T
pub fn current_value(&self) -> T
Current value based on elapsed time, without advancing.
pub fn reset(&mut self)
pub fn progress(&self) -> f32
Auto Trait Implementations§
impl<T> Freeze for TweenSequence<T>where
T: Freeze,
impl<T> RefUnwindSafe for TweenSequence<T>where
T: RefUnwindSafe,
impl<T> Send for TweenSequence<T>where
T: Send,
impl<T> Sync for TweenSequence<T>where
T: Sync,
impl<T> Unpin for TweenSequence<T>where
T: Unpin,
impl<T> UnsafeUnpin for TweenSequence<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TweenSequence<T>where
T: UnwindSafe,
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