Skip to main content

Module anim

Module anim 

Source
Expand description

Animation primitives: tweens, springs, keyframes, sequences, and staggers.

All animations are tick-based — call the value() method each frame with the current Context::tick to advance. No timers or threads involved.

Structs§

Keyframes
Multi-stop keyframe animation over a fixed tick duration.
Sequence
Sequential timeline that chains multiple animation segments.
Spring
Spring physics animation that settles toward a target value.
Stagger
Parallel staggered animation where each item starts after a fixed delay.
Tween
Linear interpolation between two values over a duration, with optional easing.

Enums§

LoopMode
Defines how an animation behaves after reaching its end.

Functions§

ease_in_cubic
Cubic ease-in: slow start, fast end (stronger than quadratic).
ease_in_out_cubic
Cubic ease-in-out: slow start, fast middle, slow end (stronger than quadratic).
ease_in_out_quad
Quadratic ease-in-out: slow start, fast middle, slow end.
ease_in_quad
Quadratic ease-in: slow start, fast end.
ease_linear
Linear easing: constant rate from 0.0 to 1.0.
ease_out_bounce
Bounce ease-out: simulates a ball bouncing before coming to rest.
ease_out_cubic
Cubic ease-out: fast start, slow end (stronger than quadratic).
ease_out_elastic
Elastic ease-out: overshoots the target and oscillates before settling.
ease_out_quad
Quadratic ease-out: fast start, slow end.
lerp
Linear interpolation between a and b at position t (0.0..=1.0).