window

tweens

the curves, and the one shared ticker they all run on

the WHY is not on this page. how the abi got this shape lives in how the abi is designed, and what a wrapped call MEANS is answered by the c++ header underneath it

the tweens

one manager per host, ticked by the pump, see tween.h

int32_t gui_tween_start(gui_host_t* _host, float* _target, float _to, int32_t _dur_ms, int32_t _curve, gui_control_t* _repaint, int64_t* _id);
int32_t gui_tween_cancel(gui_host_t* _host, int64_t _id);
int32_t gui_tween_finish(gui_host_t* _host, int64_t _id);
int32_t gui_tween_kill(gui_host_t* _host, float* _target);
int32_t gui_tween_cancel_all(gui_host_t* _host);
int32_t gui_tween_live(gui_host_t* _host, int32_t* _out);
int32_t gui_tween_set_enabled(gui_host_t* _host, int32_t _on);

_target is a float YOU own, a 4 byte buffer on your side, n it has to outlive the tween or be killed first. that is the one way to crash through this abi, so gui_tween_kill before you free it is the rule

  • _repaint is optional n BORROWED, it is asked for a frame after every write, so animating a plain number that a paint then reads is the whole use
  • an _id of 0 back means it SNAPPED instead of animating, i.e. tweens are off. that is not an error, the status is still gui_ok
  • a stale id is a no-op on both cancel n finish, so holding one past the end is safe
  • set_enabled off makes every start snap to its end at once, i.e. a reduced motion setting
  • _curve is a gui_ease_t, gui_ease_linear, gui_ease_in, gui_ease_out or gui_ease_in_out, all four monotonic so nothing overshoots

a done callback is P1.24, so today gui_tween_live is how you find out anything is still running

On this page