Skip to main content

Module animation

Module animation 

Source
Expand description

Composable animation primitives.

Includes Timeline for multi-event animation scheduling.

Time-based animations that produce normalized f32 values (0.0–1.0). Designed for zero allocation during tick, composable via generics.

§Budget Integration

Animations themselves are budget-unaware. The caller decides whether to call Animation::tick based on the current DegradationLevel:

if budget.degradation().render_decorative() {
    my_animation.tick(dt);
}

Re-exports§

pub use callbacks::AnimationEvent;
pub use callbacks::Callbacks;
pub use group::AnimationGroup;
pub use presets::InvertedFade;
pub use spring::Spring;
pub use stagger::StaggerMode;
pub use stagger::stagger_offsets;
pub use stagger::stagger_offsets_with_jitter;
pub use timeline::Timeline;

Modules§

callbacks
Animation callbacks: event hooks at animation milestones.
group
Animation group: shared lifecycle management for multiple animations.
presets
Ready-to-use animation presets built from core primitives.
spring
Damped harmonic oscillator (spring) animation.
stagger
Stagger utilities: coordinated delay offsets for animation lists.
timeline
Timeline: multi-event animation scheduler.

Structs§

Delayed
Wait for a delay, then play the inner animation.
Fade
Linear progression from 0.0 to 1.0 over a duration, with configurable easing.
Parallel
Play animations A and B simultaneously.
Pulse
Continuous sine-wave oscillation. Never completes.
Sequence
Play animation A, then animation B.
Slide
Interpolates an i16 value between from and to over a duration.

Traits§

Animation
A time-based animation producing values in [0.0, 1.0].

Functions§

delay
Create a Delayed animation.
ease_in
Quadratic ease-in (slow start).
ease_in_cubic
Cubic ease-in (slower start than quadratic).
ease_in_out
Quadratic ease-in-out (slow start and end).
ease_out
Quadratic ease-out (slow end).
ease_out_cubic
Cubic ease-out (slower end than quadratic).
linear
Identity easing (constant velocity).
parallel
Create a Parallel pair from two animations.
sequence
Create a Sequence from two animations.

Type Aliases§

EasingFn
Easing function signature: maps t in [0, 1] to output in [0, 1].