lv_lottie.h

Functions

lv_obj_t *lv_lottie_create(lv_obj_t *parent)

Create a lottie animation

参数:

parent -- pointer to the parent widget

返回:

pointer to the created Lottie animation widget

void lv_lottie_set_buffer(lv_obj_t *obj, int32_t w, int32_t h, void *buf)

Set a buffer for the animation. It also defines the size of the animation

参数:
  • obj -- pointer to a lottie widget

  • w -- width of the animation and buffer

  • h -- height of the animation and buffer

  • buf -- a static buffer with width x height x 4 byte size

void lv_lottie_set_draw_buf(lv_obj_t *obj, lv_draw_buf_t *draw_buf)

Set a draw buffer for the animation. It also defines the size of the animation

参数:
  • obj -- pointer to a lottie widget

  • draw_buf -- an initialized draw buffer with ARGB8888 color format

void lv_lottie_set_src_data(lv_obj_t *obj, const void *src, size_t src_size)

Set the source for the animation as an array

参数:
  • obj -- pointer to a lottie widget

  • src -- the lottie animation converted to an nul terminated array

  • src_size -- size of the source array in bytes

void lv_lottie_set_src_file(lv_obj_t *obj, const char *src)

Set the source for the animation as a path. Lottie doesn't use LVGL's File System API.

参数:
  • obj -- pointer to a lottie widget

  • src -- path to a json file, e.g. "path/to/file.json"

lv_anim_t *lv_lottie_get_anim(lv_obj_t *obj)

Get the LVGL animation which controls the lottie animation

参数:

obj -- pointer to a lottie widget

返回:

the LVGL animation