Expand description
The rsx motion engine: signal-backed values that chase a target over time,
driven by a central frame ticker. An Animated<T> wraps a reactive signal
whose value is interpolated toward target by a Curve (a Tween or a
Spring); tick advances every registered animation once per frame.
Colors interpolate in Oklch (see Lerp) as a deliberate perceptual choice.
Structs§
- Animated
- A signal-backed value that chases a
targetover time under aCurve, driven by the central ticker. - Continuous
- Keeps frames coming while it lives, for content Telar cannot see changing.
- Keyframes
- A signal-backed, autonomous multi-step animation: it plays a fixed sequence rather than chasing a
live target, driven by the same central ticker as
crate::Animated. - Keyframes
Builder - Accumulates steps for a
Keyframessequence before it starts. - Spring
- A physical spring parameterized by raw
stiffness,damping, andmass. - Tween
- A time-based interpolation over a fixed
durationshaped byeasing.
Enums§
- Curve
- The motion model backing an
crate::Animatedvalue. - Easing
- Timing function mapping normalized time
tin[0, 1]to eased progress. - Repeat
- How a
Keyframessequence behaves once it reaches its last step.
Traits§
- Lerp
- Interpolation plus the minimal vector-space operations the engine needs.
Functions§
- has_
active - Whether any animation is still unsettled; the runner uses this to keep scheduling frames. Non-mutating: a Weak can go dead between
tickand this call, so it re-tests liveness rather than trusting emptiness. - has_
continuous - Whether any
Continuousregion is alive. The runner keeps scheduling frames while it is true, and moves the content generation so the renderer cannot mistake identical commands for an identical frame. - reset
- Drop all registered animations; parallels reactive
reset_runtimeon tree teardown / hot reload. - set_
scale - Set the global time scale (D5). 1.0 is normal; 0.0 makes animations jump instantly to their targets; values in between slow motion down. Negative inputs clamp to 0.0.
- spring
- Build a
Springfrom stiffness and damping; mass defaults to 1.0. - tick
- Integrate every active animation to
now, publishing changed values and deregistering settled ones. - tween
- Build a
Tweenfrom a duration and easing.