BoxedTweenable

Type Alias BoxedTweenable 

Source
pub type BoxedTweenable = Box<dyn Tweenable + '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, 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 {
    fn from(t: MyTweenable) -> Self {
        Box::new(t)
    }
}

Aliased Type§

pub struct BoxedTweenable(/* private fields */);

Trait Implementations§

Source§

impl From<Delay> for BoxedTweenable

Source§

fn from(t: Delay) -> Self

Converts to this type from the input type.
Source§

impl From<Sequence> for BoxedTweenable

Source§

fn from(t: Sequence) -> Self

Converts to this type from the input type.
Source§

impl From<Tween> for BoxedTweenable

Source§

fn from(t: Tween) -> Self

Converts to this type from the input type.
Source§

impl IntoBoxedTweenable for BoxedTweenable