pub struct Tween<T> {
pub from: T,
pub to: T,
pub duration_ms: u32,
pub easing: EasingFunction,
/* private fields */
}Expand description
A tween that interpolates between two values over time.
Fields§
§from: TStarting value
to: TEnding value
duration_ms: u32Duration in milliseconds
easing: EasingFunctionEasing function
Implementations§
Source§impl<T: Clone> Tween<T>
impl<T: Clone> Tween<T>
Sourcepub const fn with_easing(self, easing: EasingFunction) -> Self
pub const fn with_easing(self, easing: EasingFunction) -> Self
Set the easing function.
Sourcepub fn eased_progress(&self) -> f32
pub fn eased_progress(&self) -> f32
Get the eased progress value.
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
Check if the tween is complete.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Tween<T>where
T: Freeze,
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> UnwindSafe for Tween<T>where
T: UnwindSafe,
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