pub struct Tween2D { /* private fields */ }Expand description
Vector tween.
Implementations§
Source§impl Tween2D
impl Tween2D
Sourcepub fn new(
from_x: f32,
from_y: f32,
to_x: f32,
to_y: f32,
duration: f32,
) -> Self
pub fn new( from_x: f32, from_y: f32, to_x: f32, to_y: f32, duration: f32, ) -> Self
Create a vector tween.
Sourcepub fn to_array(&self) -> Float32Array
pub fn to_array(&self) -> Float32Array
Return all vector components.
Sourcepub fn eased_progress(&self) -> f32
pub fn eased_progress(&self) -> f32
Current eased progress in [0, 1].
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether playback is complete.
Sourcepub fn set_time_scale(&self, scale: f32)
pub fn set_time_scale(&self, scale: f32)
Set playback time scale.
Trait Implementations§
Source§impl FromWasmAbi for Tween2D
impl FromWasmAbi for Tween2D
Source§impl IntoWasmAbi for Tween2D
impl IntoWasmAbi for Tween2D
Source§impl LongRefFromWasmAbi for Tween2D
impl LongRefFromWasmAbi for Tween2D
Source§impl OptionFromWasmAbi for Tween2D
impl OptionFromWasmAbi for Tween2D
Source§impl OptionIntoWasmAbi for Tween2D
impl OptionIntoWasmAbi for Tween2D
Source§impl RefFromWasmAbi for Tween2D
impl RefFromWasmAbi for Tween2D
Source§type Abi = WasmPtr<WasmRefCell<Tween2D>>
type Abi = WasmPtr<WasmRefCell<Tween2D>>
The Wasm ABI type references to
Self are recovered from.Source§impl RefMutFromWasmAbi for Tween2D
impl RefMutFromWasmAbi for Tween2D
Source§impl TryFromJsValue for Tween2D
impl TryFromJsValue for Tween2D
Source§impl VectorFromWasmAbi for Tween2D
impl VectorFromWasmAbi for Tween2D
Source§impl VectorIntoWasmAbi for Tween2D
impl VectorIntoWasmAbi for Tween2D
impl SupportsConstructor for Tween2D
impl SupportsInstanceProperty for Tween2D
impl SupportsStaticProperty for Tween2D
Auto Trait Implementations§
impl Freeze for Tween2D
impl RefUnwindSafe for Tween2D
impl Send for Tween2D
impl Sync for Tween2D
impl Unpin for Tween2D
impl UnsafeUnpin for Tween2D
impl UnwindSafe for Tween2D
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.