Skip to main content

Tween

Struct Tween 

Source
pub struct Tween<T> {
    pub begin: Option<T>,
    pub end: Option<T>,
}
Expand description

A linear interpolation between a beginning and ending value.

Tweens are mutable: set_begin / set_end after Animatable::animate is visible to the driven animation, as in Dart.

Fields§

§begin: Option<T>

The value this variable has at the beginning of the animation.

§end: Option<T>

The value this variable has at the end of the animation.

Implementations§

Source§

impl<T> Tween<T>
where T: 'static,

Source

pub fn new( app: &mut App, begin: Option<T>, end: Option<T>, ) -> Retained<Handle<Tween<T>>>

Creates a tween.

The begin and end properties must be non-null before the tween is first used, but the arguments can be null if the values are going to be filled in later.

Source

pub fn begin(self: Handle<Tween<T>>, app: &App) -> Option<&T>

The value this variable has at the beginning of the animation.

Source

pub fn set_begin(self: Handle<Tween<T>>, app: &mut App, begin: Option<T>)

Dart’s begin setter.

Source

pub fn end(self: Handle<Tween<T>>, app: &App) -> Option<&T>

The value this variable has at the end of the animation.

Source

pub fn set_end(self: Handle<Tween<T>>, app: &mut App, end: Option<T>)

Dart’s end setter.

Source§

impl<T> Tween<T>
where T: TweenLerp + 'static,

Source

pub fn lerp(self: Handle<Tween<T>>, app: &App, t: f64) -> T

Returns the value this variable has at the given animation clock value.

Trait Implementations§

Source§

impl<T> Debug for Tween<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Forget for Tween<T>

§

impl<T> Freeze for Tween<T>
where T: Freeze,

§

impl<T> Move for Tween<T>

§

impl<T> RefUnwindSafe for Tween<T>
where T: RefUnwindSafe,

§

impl<T> Send for Tween<T>
where T: Send,

§

impl<T> Sync for Tween<T>
where T: Sync,

§

impl<T> Unpin for Tween<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Tween<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Tween<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,