pub struct Tween { /* private fields */ }Expand description
Scalar tween from one number to another.
Implementations§
Source§impl Tween
impl Tween
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_cubic_bezier(&self, x1: f32, y1: f32, x2: f32, y2: f32)
pub fn set_cubic_bezier(&self, x1: f32, y1: f32, x2: f32, y2: f32)
Set CSS cubic-bezier easing.
Sourcepub fn set_time_scale(&self, scale: f32)
pub fn set_time_scale(&self, scale: f32)
Set playback time scale.
Sourcepub fn set_loop_count(&self, count: u32)
pub fn set_loop_count(&self, count: u32)
Loop a fixed number of passes.
Sourcepub fn set_loop_mode(&self, mode: &str) -> Result<(), JsValue>
pub fn set_loop_mode(&self, mode: &str) -> Result<(), JsValue>
Set loop mode by string: once, forever, pingPong, or timesN.
Sourcepub fn set_ping_pong(&self)
pub fn set_ping_pong(&self)
Use ping-pong looping.
Sourcepub fn set_forever(&self)
pub fn set_forever(&self)
Use infinite looping.
Trait Implementations§
Source§impl FromWasmAbi for Tween
impl FromWasmAbi for Tween
Source§impl IntoWasmAbi for Tween
impl IntoWasmAbi for Tween
Source§impl LongRefFromWasmAbi for Tween
impl LongRefFromWasmAbi for Tween
Source§impl OptionFromWasmAbi for Tween
impl OptionFromWasmAbi for Tween
Source§impl OptionIntoWasmAbi for Tween
impl OptionIntoWasmAbi for Tween
Source§impl RefFromWasmAbi for Tween
impl RefFromWasmAbi for Tween
Source§type Abi = WasmPtr<WasmRefCell<Tween>>
type Abi = WasmPtr<WasmRefCell<Tween>>
The Wasm ABI type references to
Self are recovered from.Source§impl RefMutFromWasmAbi for Tween
impl RefMutFromWasmAbi for Tween
Source§impl TryFromJsValue for Tween
impl TryFromJsValue for Tween
Source§impl VectorFromWasmAbi for Tween
impl VectorFromWasmAbi for Tween
Source§impl VectorIntoWasmAbi for Tween
impl VectorIntoWasmAbi for Tween
impl SupportsConstructor for Tween
impl SupportsInstanceProperty for Tween
impl SupportsStaticProperty for Tween
Auto Trait Implementations§
impl Freeze for Tween
impl RefUnwindSafe for Tween
impl Send for Tween
impl Sync for Tween
impl Unpin for Tween
impl UnsafeUnpin for Tween
impl UnwindSafe for Tween
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.