pub struct SequenceBuilder<T: Lerp + Clone + Debug> { /* private fields */ }Expand description
Fluent builder for TweenSequence.
use proof_engine::tween::sequence::SequenceBuilder;
use proof_engine::tween::Easing;
let seq = SequenceBuilder::new(0.0f32)
.then(0.0, 1.0, 0.5, Easing::EaseOutCubic)
.then(1.0, 0.5, 0.3, Easing::EaseInQuad)
.overlap(0.1)
.looping(false)
.build();Implementations§
Source§impl<T: Lerp + Clone + Debug> SequenceBuilder<T>
impl<T: Lerp + Clone + Debug> SequenceBuilder<T>
pub fn new(default_val: T) -> Self
Sourcepub fn then(self, from: T, to: T, duration: f32, easing: Easing) -> Self
pub fn then(self, from: T, to: T, duration: f32, easing: Easing) -> Self
Add a tween step from from to to over duration seconds.
Sourcepub fn overlap(self, seconds: f32) -> Self
pub fn overlap(self, seconds: f32) -> Self
Set overlap (in seconds) for the next step. Positive = overlap with previous.
pub fn looping(self, looping: bool) -> Self
pub fn build(self) -> TweenSequence<T>
Auto Trait Implementations§
impl<T> Freeze for SequenceBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for SequenceBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for SequenceBuilder<T>where
T: Send,
impl<T> Sync for SequenceBuilder<T>where
T: Sync,
impl<T> Unpin for SequenceBuilder<T>where
T: Unpin,
impl<T> UnsafeUnpin for SequenceBuilder<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SequenceBuilder<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
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.