RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
Motion and property animation

Element motion

rmgui_element_motion_recipes lists six read-only recipes: hover, press, lift, attention, refusal and sway.

Attribute Rule
Endpoints Scale and colour come from the current resolved style.
Springs Divide raw Q16 position by 16 before mixing; preserve overshoot and the rest threshold.
Waves rmgui_motion_wave rounds the amplitude/wave mix before applying decay, in the amplitude's units. Element shakes use whole device pixels.
Retiming Preserves envelope fraction, not wave phase.
Storage The host owns state. Recipes have static lifetime. No allocation.

Element motion contract

Tracks

Need tracks behavior
Animate Tweens, springs, borrowed keyframes, noise and sine envelopes. Sequence, parallel and stagger groups.
Channels Built-in transforms, tint, glow/shadow and radius; IDs from RMGUI_TRACK_USER are host properties.
Mix Play order; override, saturating add or Q16 multiply.
Time and values Host advances in uint32 milliseconds. Values are signed Q16. Pause, scale time, seek or retarget to a velocity-preserving spring.
Waves spec.wave sets period/cell; spec.ease sets decay. The two mixes round independently.
Storage Caller-owned slots and events. Clear held slots before reuse. Drain event_count after consuming requests; a full queue refuses the advance without mutation.
Presets rmgui_tracks_feel_recipe borrows the static template; rmgui_tracks_feel fills dynamic values. Copy and edit either. Flash/pop halve duration and yoyo; punch applies a saturated kick and returns to its start.
Reduced motion Use rmgui_tracks_finish after play or a preference change. It atomically queues completions, snaps springs, zeros waves, respects hold and finite yoyo direction, and finishes the first cycle of infinite loops. It ignores pause.

rmgui_tracks_layer writes built-in layer values without painting or allocating. See the tracks contract.

Paint with track values

tracks_style API Output
rmgui_track_property_t Map arbitrary channels to a scalar or normalized RGBA.
rmgui_tracks_style_field Resolve and unlink a schema reference, floor scalar Q16, check row bounds, round/clamp RGBA. Validate cross-field rules separately.
rmgui_tracks_ext_property Project into a resolved extension property and check INT/LENGTH/ENUM bounds. Supply the resolve scale (1–400); lengths use device pixels.

Project into a fresh paint snapshot after step, seek or finish. Numeric bases must fit -32768..32767; invalid input returns -1 unchanged. See the projection contract or try Motion tracks in the showcase.