pub struct StaggeredAnimation<T: Interpolate> {
pub base_delay: f32,
pub stagger_delay: f32,
pub duration: f32,
pub easing: EasingFunction,
/* private fields */
}Expand description
Staggered animation system for multiple items
Creates a choreographed animation where items animate in sequence with configurable delays between them.
§Example
use armas_basic::animation::StaggeredAnimation;
// Fade in 5 items, each delayed by 0.1s, taking 0.3s each
let mut anim = StaggeredAnimation::new(0.0_f32, 1.0, 5, 0.1, 0.3);
anim.update(0.2);
let opacity_0 = anim.opacity(0); // mostly visible
let opacity_4 = anim.opacity(4); // not started yetFields§
§base_delay: f32Base delay before first item starts (seconds)
stagger_delay: f32Delay between each item (seconds)
duration: f32Duration of each item’s animation (seconds)
easing: EasingFunctionEasing function for each item
Implementations§
Source§impl<T: Interpolate> StaggeredAnimation<T>
impl<T: Interpolate> StaggeredAnimation<T>
Sourcepub const fn new(
start: T,
end: T,
item_count: usize,
stagger_delay: f32,
duration: f32,
) -> Self
pub const fn new( start: T, end: T, item_count: usize, stagger_delay: f32, duration: f32, ) -> Self
Create a new staggered animation
Sourcepub const fn base_delay(self, delay: f32) -> Self
pub const fn base_delay(self, delay: f32) -> Self
Set the base delay before first item
Sourcepub const fn easing(self, easing: EasingFunction) -> Self
pub const fn easing(self, easing: EasingFunction) -> Self
Set the easing function
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all items have completed
Trait Implementations§
Source§impl<T: Clone + Interpolate> Clone for StaggeredAnimation<T>
impl<T: Clone + Interpolate> Clone for StaggeredAnimation<T>
Source§fn clone(&self) -> StaggeredAnimation<T>
fn clone(&self) -> StaggeredAnimation<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for StaggeredAnimation<T>where
T: Freeze,
impl<T> RefUnwindSafe for StaggeredAnimation<T>where
T: RefUnwindSafe,
impl<T> Send for StaggeredAnimation<T>where
T: Send,
impl<T> Sync for StaggeredAnimation<T>where
T: Sync,
impl<T> Unpin for StaggeredAnimation<T>where
T: Unpin,
impl<T> UnsafeUnpin for StaggeredAnimation<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for StaggeredAnimation<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