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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)