pub struct Tweened<T: Lerp + Clone + 'static>(/* private fields */);
Expand description
A state that is interpolated when it is set.
Implementations§
Source§impl<T: Lerp + Clone> Tweened<T>
impl<T: Lerp + Clone> Tweened<T>
Sourcepub fn set(&self, _new_value: T)
pub fn set(&self, _new_value: T)
Set the target value for the Tweened
. The existing value will be interpolated to the
target value with the specified transition_duration
and easing_fn
.
If the value is being interpolated already due to a previous call to set()
, the previous
task will be canceled.
To immediately set the value without interpolating the value, use signal().set(...)
instead.
If not running on wasm32-unknown-unknown
, does nothing.
Sourcepub fn get_untracked(&self) -> Twhere
T: Copy,
pub fn get_untracked(&self) -> Twhere
T: Copy,
Alias for signal().get_untracked()
.
Sourcepub fn is_tweening(&self) -> bool
pub fn is_tweening(&self) -> bool
Returns true
if the value is currently being tweened/interpolated. This value is reactive
and can be tracked.
Trait Implementations§
impl<T: Lerp + Clone + 'static> Copy for Tweened<T>
Auto Trait Implementations§
impl<T> Freeze for Tweened<T>
impl<T> !RefUnwindSafe for Tweened<T>
impl<T> !Send for Tweened<T>
impl<T> !Sync for Tweened<T>
impl<T> Unpin for Tweened<T>where
T: Unpin,
impl<T> !UnwindSafe for Tweened<T>
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