lv_anim_timeline.h

Defines

LV_ANIM_TIMELINE_PROGRESS_MAX

Typedefs

typedef struct _lv_anim_timeline_t lv_anim_timeline_t

Functions

lv_anim_timeline_t *lv_anim_timeline_create(void)

Create an animation timeline.

Returns:

pointer to the animation timeline.

void lv_anim_timeline_delete(lv_anim_timeline_t *at)

Delete animation timeline.

Parameters:

at – pointer to the animation timeline.

void lv_anim_timeline_add(lv_anim_timeline_t *at, uint32_t start_time, const lv_anim_t *a)

Add animation to the animation timeline.

Parameters:
  • at – pointer to the animation timeline.

  • start_time – the time the animation started on the timeline, note that start_time will override the value of delay.

  • a – pointer to an animation.

uint32_t lv_anim_timeline_start(lv_anim_timeline_t *at)

Start the animation timeline.

Parameters:

at – pointer to the animation timeline.

Returns:

total time spent in animation timeline.

void lv_anim_timeline_pause(lv_anim_timeline_t *at)

Pause the animation timeline.

Parameters:

at – pointer to the animation timeline.

void lv_anim_timeline_set_reverse(lv_anim_timeline_t *at, bool reverse)

Set the playback direction of the animation timeline.

Parameters:
  • at – pointer to the animation timeline.

  • reverse – whether to play in reverse.

void lv_anim_timeline_set_repeat_count(lv_anim_timeline_t *at, uint32_t cnt)

Make the animation timeline repeat itself.

Parameters:
  • at – pointer to the animation timeline.

  • cnt – repeat count or LV_ANIM_REPEAT_INFINITE for infinite repetition. 0: to disable repetition.

void lv_anim_timeline_set_repeat_delay(lv_anim_timeline_t *at, uint32_t delay)

Set a delay before repeating the animation timeline.

Parameters:
  • at – pointer to the animation timeline.

  • delay – delay in milliseconds before repeating the animation timeline.

void lv_anim_timeline_set_progress(lv_anim_timeline_t *at, uint16_t progress)

Set the progress of the animation timeline.

Parameters:
  • at – pointer to the animation timeline.

  • progress – set value 0~65535 to map 0~100% animation progress.

uint32_t lv_anim_timeline_get_playtime(lv_anim_timeline_t *at)

Get the time used to play the animation timeline.

Parameters:

at – pointer to the animation timeline.

Returns:

total time spent in animation timeline.

bool lv_anim_timeline_get_reverse(lv_anim_timeline_t *at)

Get whether the animation timeline is played in reverse.

Parameters:

at – pointer to the animation timeline.

Returns:

return true if it is reverse playback.

uint16_t lv_anim_timeline_get_progress(lv_anim_timeline_t *at)

Get the progress of the animation timeline.

Parameters:

at – pointer to the animation timeline.

Returns:

return value 0~65535 to map 0~100% animation progress.

uint32_t lv_anim_timeline_get_repeat_count(lv_anim_timeline_t *at)

Get repeat count of the animation timeline.

Parameters:

at – pointer to the animation timeline.

uint32_t lv_anim_timeline_get_repeat_delay(lv_anim_timeline_t *at)

Get repeat delay of the animation timeline.

Parameters:

at – pointer to the animation timeline.