pub struct TweenSequence<T> { /* private fields */ }Expand description
The rest of the animation layer: tweens chained and curved, the scroll simulations and
their constants.
A run of Animatable segments chained along the [0,1] progress value: each
segment gets a share proportional to its weight. One progress value can thus
cross several stages — a multi-step morph (colour A → B → C), a bounce (grow
then come back), or a sequence with distinct rhythms (one segment .curved, the
other linear).
TweenSequence is itself an Animatable: it can be .curved() and
.animate()d like any other tween.
Implementations§
Source§impl<T> TweenSequence<T>
impl<T> TweenSequence<T>
Sourcepub fn new(
first: impl Animatable<Output = T> + 'static,
weight: f32,
) -> TweenSequence<T>
pub fn new( first: impl Animatable<Output = T> + 'static, weight: f32, ) -> TweenSequence<T>
Starts a run with its first segment and weight; a negative weight is clamped to zero.
Sourcepub fn then(
self,
next: impl Animatable<Output = T> + 'static,
weight: f32,
) -> TweenSequence<T>
pub fn then( self, next: impl Animatable<Output = T> + 'static, weight: f32, ) -> TweenSequence<T>
Chains one more segment, taking up weight of the total progress.
Trait Implementations§
Source§impl<T> Animatable for TweenSequence<T>
impl<T> Animatable for TweenSequence<T>
Source§fn curved(self, curve: Curve) -> Curved<Self>where
Self: Sized,
fn curved(self, curve: Curve) -> Curved<Self>where
Self: Sized,
Chains a
Curve before evaluation: t is shaped by the curve first,
so a single linear progress value can drive a value with non-linear timing.Source§fn animate<'a>(
&'a self,
controller: &'a AnimationController,
) -> Animation<'a, Self>where
Self: Sized,
fn animate<'a>(
&'a self,
controller: &'a AnimationController,
) -> Animation<'a, Self>where
Self: Sized,
Binds this animation to an
AnimationController’s progress, producing an
Animation whose value() follows the controller’s current value. The
controller’s value is normalised by its own bounds, so a non-unit
controller still drives a full [0,1].Auto Trait Implementations§
impl<T> !RefUnwindSafe for TweenSequence<T>
impl<T> !Send for TweenSequence<T>
impl<T> !Sync for TweenSequence<T>
impl<T> !UnwindSafe for TweenSequence<T>
impl<T> Freeze for TweenSequence<T>
impl<T> Unpin for TweenSequence<T>
impl<T> UnsafeUnpin for TweenSequence<T>
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