Skip to content
modkitv0.2

tween.h

#include <modkit/tween.h>25 functions · 5 structs · 1 unions · 1 enums · 10 typedefs · 2 macros

Explicit-clock typed tweens and composable timelines.

Functions

mk_tween_appendfunction

mk_result mk_tween_append(mk_tween_world_t *world, mk_tween_t tween, const mk_tween_track_desc *track)

Append after the timeline cursor and advance it by duration.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
trackconst mk_tween_track_desc *Value for track.

Returns MK_SUCCESS or an error result.

mk_tween_append_delayfunction

mk_result mk_tween_append_delay(mk_tween_world_t *world, mk_tween_t tween, float duration)

Perform the tween append delay operation.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
durationfloatValue for duration.

Returns MK_SUCCESS or an error result.

mk_tween_append_timelinefunction

mk_result mk_tween_append_timeline(mk_tween_world_t *world, mk_tween_t tween, mk_tween_t nested)

Perform the tween append timeline operation.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
nestedmk_tween_tValue for nested.

Returns MK_SUCCESS or an error result.

mk_tween_completefunction

bool mk_tween_complete(const mk_tween_world_t *world, mk_tween_t tween)

Perform the tween complete operation.

ParameterTypeDescription
worldconst mk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

Returns True when the operation succeeds.

mk_tween_createfunction

mk_tween_t mk_tween_create(mk_tween_world_t *world, const mk_tween_desc *desc)

Create tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
descconst mk_tween_desc *Configuration descriptor.

Returns The resulting handle or value.

mk_tween_destroyfunction

void mk_tween_destroy(mk_tween_world_t *world, mk_tween_t tween)

Destroy the tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

mk_tween_durationfunction

float mk_tween_duration(const mk_tween_world_t *world, mk_tween_t tween)

Perform the tween duration operation.

ParameterTypeDescription
worldconst mk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

Returns The resulting value.

mk_tween_insertfunction

mk_result mk_tween_insert(mk_tween_world_t *world, mk_tween_t tween, float at, const mk_tween_track_desc *track)

Insert at an absolute timeline time.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
atfloatValue for at.
trackconst mk_tween_track_desc *Value for track.

Returns MK_SUCCESS or an error result.

mk_tween_insert_callbackfunction

mk_result mk_tween_insert_callback(mk_tween_world_t *world, mk_tween_t tween, float at, mk_tween_callback_fn callback, void *user_data)

Perform the tween insert callback operation.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
atfloatValue for at.
callbackmk_tween_callback_fnCompletion callback.
user_datavoid *Caller-provided context.

Returns MK_SUCCESS or an error result.

mk_tween_insert_timelinefunction

mk_result mk_tween_insert_timeline(mk_tween_world_t *world, mk_tween_t tween, float at, mk_tween_t nested)

Perform the tween insert timeline operation.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
atfloatValue for at.
nestedmk_tween_tValue for nested.

Returns MK_SUCCESS or an error result.

mk_tween_joinfunction

mk_result mk_tween_join(mk_tween_world_t *world, mk_tween_t tween, const mk_tween_track_desc *track)

Start at the most recently appended item's start time (parallel join).

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
trackconst mk_tween_track_desc *Value for track.

Returns MK_SUCCESS or an error result.

mk_tween_pausefunction

void mk_tween_pause(mk_tween_world_t *world, mk_tween_t tween)

Pause the tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

mk_tween_playfunction

void mk_tween_play(mk_tween_world_t *world, mk_tween_t tween)

Play tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

mk_tween_restartfunction

void mk_tween_restart(mk_tween_world_t *world, mk_tween_t tween)

Perform the tween restart operation.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

mk_tween_seekfunction

void mk_tween_seek(mk_tween_world_t *world, mk_tween_t tween, float time)

Seek tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
timefloatValue for time.

mk_tween_set_cancel_callbackfunction

void mk_tween_set_cancel_callback(mk_tween_world_t *world, mk_tween_t tween, mk_tween_callback_fn callback, void *user_data)

Set cancel callback on the tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
callbackmk_tween_callback_fnCompletion callback.
user_datavoid *Caller-provided context.

mk_tween_set_completion_callbackfunction

void mk_tween_set_completion_callback(mk_tween_world_t *world, mk_tween_t tween, mk_tween_callback_fn callback, void *user_data)

Set completion callback on the tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
callbackmk_tween_callback_fnCompletion callback.
user_datavoid *Caller-provided context.

mk_tween_set_loopsfunction

void mk_tween_set_loops(mk_tween_world_t *world, mk_tween_t tween, uint32_t repeat_count, bool yoyo)

Set loops on the tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
repeat_countuint32_tNumber of repeat entries.
yoyoboolValue for yoyo.

mk_tween_set_speedfunction

void mk_tween_set_speed(mk_tween_world_t *world, mk_tween_t tween, float speed)

Set speed on the tween.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.
speedfloatValue for speed.

mk_tween_timefunction

float mk_tween_time(const mk_tween_world_t *world, mk_tween_t tween)

Perform the tween time operation.

ParameterTypeDescription
worldconst mk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

Returns The resulting value.

mk_tween_validfunction

bool mk_tween_valid(const mk_tween_world_t *world, mk_tween_t tween)

Perform the tween valid operation.

ParameterTypeDescription
worldconst mk_tween_world_t *Value for world.
tweenmk_tween_tValue for tween.

Returns True when the operation succeeds.

mk_tween_world_countfunction

uint32_t mk_tween_world_count(const mk_tween_world_t *world)

Perform the tween world count operation.

ParameterTypeDescription
worldconst mk_tween_world_t *Value for world.

Returns The resulting value.

mk_tween_world_createfunction

mk_tween_world_t * mk_tween_world_create(const mk_tween_world_desc *desc)

Create tween world.

ParameterTypeDescription
descconst mk_tween_world_desc *Configuration descriptor.

Returns A borrowed pointer, or NULL when unavailable.

mk_tween_world_destroyfunction

void mk_tween_world_destroy(mk_tween_world_t *world)

Destroy the tween world.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.

mk_tween_world_stepfunction

void mk_tween_world_step(mk_tween_world_t *world, float dt)

Perform the tween world step operation.

ParameterTypeDescription
worldmk_tween_world_t *Value for world.
dtfloatValue for dt.

Structs

mk_tweenstruct

Data for tween.

FieldTypeDescription
iduint32_tThe ID.

mk_tween_bindingstruct

Data for tween binding.

FieldTypeDescription
typemk_tween_value_typeThe type.
settermk_tween_setter_fnThe setter.
user_datavoid *The user data.

mk_tween_descstruct

Data for tween desc.

FieldTypeDescription
speedfloatThe speed.
pausedboolThe paused.
auto_destroyboolThe auto destroy.

mk_tween_track_descstruct

Data for tween track desc.

FieldTypeDescription
bindingmk_tween_bindingThe binding.
frommk_tween_valueThe from.
tomk_tween_valueThe to.
durationfloatThe duration.
easemk_ease_typeThe ease.
curvemk_curve_tWhen valid, overrides ease and is retained by the timeline.
relativeboolThe relative.

mk_tween_world_descstruct

Data for tween world desc.

FieldTypeDescription
capacityuint32_tMaximum live timelines; 0 selects 256.

Unions

mk_tween_valueunion

Data for tween value.

FieldTypeDescription
ffloatThe f.
vec2mk_vec2The vec2.
vec3mk_vec3The vec3.
vec4mk_vec4The vec4.
colormk_vec4The color.
quatmk_quatThe quat.

Enums

mk_tween_value_typeenum

Values for tween value type.

ValueDescription
MK_TWEEN_FLOATSelects float.
MK_TWEEN_VEC2Selects vec2.
MK_TWEEN_VEC3Selects vec3.
MK_TWEEN_VEC4Selects vec4.
MK_TWEEN_COLORSelects color.
MK_TWEEN_QUATSelects quat.

Typedefs

mk_tween_bindingtypedef

typedef struct mk_tween_binding mk_tween_binding

Data for tween binding.

mk_tween_callback_fntypedef

typedef void(*) mk_tween_callback_fn(mk_tween_t tween, void *user_data)

Callback used for tween callback.

mk_tween_desctypedef

typedef struct mk_tween_desc mk_tween_desc

Data for tween desc.

mk_tween_setter_fntypedef

typedef void(*) mk_tween_setter_fn(void *user_data, mk_tween_value_type type, const mk_tween_value *value)

Callback used for tween setter.

mk_tween_ttypedef

typedef struct mk_tween mk_tween_t

Data for tween.

mk_tween_track_desctypedef

typedef struct mk_tween_track_desc mk_tween_track_desc

Data for tween track desc.

mk_tween_valuetypedef

typedef union mk_tween_value mk_tween_value

Data for tween value.

mk_tween_value_typetypedef

typedef enum mk_tween_value_type mk_tween_value_type

Values for tween value type.

mk_tween_world_desctypedef

typedef struct mk_tween_world_desc mk_tween_world_desc

Data for tween world desc.

mk_tween_world_ttypedef

typedef struct mk_tween_world mk_tween_world_t

Type used for tween world.

Macros

MK_TWEEN_INVALIDdefine

MK_TWEEN_INVALID

Invalid sentinel for tween.

MK_TWEEN_REPEAT_FOREVERdefine

MK_TWEEN_REPEAT_FOREVER

Constant for tween repeat forever.