Type Alias bevy_tweening::BoxedTweenable

source ·
pub type BoxedTweenable<T> = Box<dyn Tweenable<T> + 'static>;
Expand description

The dynamic tweenable type.

When creating lists of tweenables, you will need to box them to create a homogeneous array like so:


Sequence::new([Box::new(delay) as BoxedTweenable<Transform>, tween.into()]);

When using your own Tweenable types, APIs will be easier to use if you implement From:


Sequence::new([Box::new(MyTweenable) as BoxedTweenable<_>]);

// OR

Sequence::new([MyTweenable]);

impl From<MyTweenable> for BoxedTweenable<Transform> {
    fn from(t: MyTweenable) -> Self {
        Box::new(t)
    }
}

Aliased Type§

struct BoxedTweenable<T>(/* private fields */);

Trait Implementations§

source§

impl<T: 'static> From<Delay<T>> for BoxedTweenable<T>

source§

fn from(t: Delay<T>) -> Self

Converts to this type from the input type.
source§

impl<T: 'static> From<Sequence<T>> for BoxedTweenable<T>

source§

fn from(t: Sequence<T>) -> Self

Converts to this type from the input type.
source§

impl<T: 'static> From<Tracks<T>> for BoxedTweenable<T>

source§

fn from(t: Tracks<T>) -> Self

Converts to this type from the input type.
source§

impl<T: 'static> From<Tween<T>> for BoxedTweenable<T>

source§

fn from(t: Tween<T>) -> Self

Converts to this type from the input type.