pub struct AnimatedTextState {
pub frame: u8,
pub wave_position: usize,
pub wave_direction: WaveDirection,
pub active: bool,
/* private fields */
}Expand description
State for animated text
Fields§
§frame: u8Current animation frame (0-255 for smooth transitions)
wave_position: usizeWave position (for wave effect)
wave_direction: WaveDirectionWave direction (for bounce behavior)
active: boolWhether the animation is active
Implementations§
Source§impl AnimatedTextState
impl AnimatedTextState
Sourcepub fn with_interval(interval_ms: u64) -> Self
pub fn with_interval(interval_ms: u64) -> Self
Create state with a specific interval
Sourcepub fn set_interval(&mut self, interval_ms: u64)
pub fn set_interval(&mut self, interval_ms: u64)
Set the animation interval
Sourcepub fn tick(&mut self) -> bool
pub fn tick(&mut self) -> bool
Advance the animation by one tick
Returns true if the frame changed
Sourcepub fn tick_with_text_width(&mut self, text_width: usize) -> bool
pub fn tick_with_text_width(&mut self, text_width: usize) -> bool
Advance the animation with known text width (for wave calculations)
Returns true if the frame changed
Sourcepub fn interpolation_factor(&self) -> f32
pub fn interpolation_factor(&self) -> f32
Get the current interpolation factor (0.0 to 1.0)
Trait Implementations§
Source§impl Clone for AnimatedTextState
impl Clone for AnimatedTextState
Source§fn clone(&self) -> AnimatedTextState
fn clone(&self) -> AnimatedTextState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnimatedTextState
impl Debug for AnimatedTextState
Auto Trait Implementations§
impl Freeze for AnimatedTextState
impl RefUnwindSafe for AnimatedTextState
impl Send for AnimatedTextState
impl Sync for AnimatedTextState
impl Unpin for AnimatedTextState
impl UnwindSafe for AnimatedTextState
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more