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 */);