lv_anim_timeline.h

Defines

LV_ANIM_TIMELINE_PROGRESS_MAX

Typedefs

typedef struct _lv_anim_timeline_dsc_t lv_anim_timeline_dsc_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_delay(lv_anim_timeline_t *at, uint32_t delay)

Set the time to wait before starting the the animation. Applies only when playing from the very start, or reverse from the very end.

Parameters:
  • at – pointer to an animation timeline

  • delay – the delay time in milliseconds

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.

void lv_anim_timeline_set_user_data(lv_anim_timeline_t *at, void *user_data)

Set the user_data of a an animation timeline

Parameters:
  • at – pointer to the animation timeline.

  • user_data – pointer to any data. Only the pointer will be saved.

void lv_anim_timeline_set_base_obj(lv_anim_timeline_t *at, lv_obj_t *base_obj)

Set base object. If set, it's assumed that the var of animations is a widget name (path). The widget pointer will be retrieved by finding them by name on this widget.

Parameters:
  • at – pointer to the animation timeline.

  • base_obj – pointer to a widget

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.

uint32_t lv_anim_timeline_get_delay(lv_anim_timeline_t *at)

Get the wait time when playing from the very start, or reverse from the very end.

Parameters:

at – pointer to an animation timeline

Returns:

the remaining time in milliseconds

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.

void *lv_anim_timeline_get_user_data(lv_anim_timeline_t *at)

Get the user_data of a an animation timeline

Parameters:

at – pointer to the animation timeline.

lv_obj_t *lv_anim_timeline_get_base_obj(lv_anim_timeline_t *at)

Get base object. If set, it's assumed that the var of animations is a widget name (path). The widget pointer will be retrieved by finding them by name on this widget.

Parameters:

at – pointer to the animation timeline.

Returns:

pointer to the base widget

struct _lv_anim_timeline_dsc_t

Public Members

lv_anim_t anim
uint32_t start_time
uint8_t is_started
uint8_t is_completed