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
AandBsimultaneously. - Pulse
- Continuous sine-wave oscillation. Never completes.
- Sequence
- Play animation
A, then animationB. - Slide
- Interpolates an
i16value betweenfromandtoover a duration.
Traits§
- Animation
- A time-based animation producing values in [0.0, 1.0].
Functions§
- delay
- Create a
Delayedanimation. - 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
Parallelpair from two animations. - sequence
- Create a
Sequencefrom two animations.
Type Aliases§
- Easing
Fn - Easing function signature: maps
tin [0, 1] to output in [0, 1].