![]() ![]() Static inline void lv_anim_set_path ( lv_anim_t * a, const lv_anim_path_t * path ) ¶ The variable to animate can be stored in the animation's user_sata Parameters This function might be used when LVGL is binded to other languages because it's more consistent to have lv_anim_t * as first parameter. Similar to lv_anim_set_exec_cb but lv_anim_custom_exec_cb_t receives lv_anim_t * as its first parameter instead of void *. Static inline void lv_anim_set_custom_exec_cb ( lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb ) ¶ Set the start and end values of an animation Parameters Static inline void lv_anim_set_values ( lv_anim_t * a, lv_anim_value_t start, lv_anim_value_t end ) ¶ Set a delay before starting the animation Parametersĭelay - delay before the animation in milliseconds Static inline void lv_anim_set_delay ( lv_anim_t * a, uint32_t delay ) ¶ Set the duration of an animation Parametersĭuration - duration of the animation in milliseconds Static inline void lv_anim_set_time ( lv_anim_t * a, uint32_t duration ) ¶ Static inline void lv_anim_set_exec_cb ( lv_anim_t * a, lv_anim_exec_xcb_t exec_cb ) ¶Įxec_cb - a function to execute during animation LittelvGL's built-in functions can be used. E.g.: lv_anim_t a lv_anim_init(&a) lv_anim_set_.(&a) ParametersĪ - pointer to an lv_anim_t variable to initialize static inline void lv_anim_set_var ( lv_anim_t * a, void * var ) ¶Ī - pointer to an initialized lv_anim_t variable ![]() the animation module void lv_anim_init ( lv_anim_t * a ) ¶ typedef void ( * lv_anim_ready_cb_t ) ( struct _lv_anim_t * ) ¶Ĭallback to call when the animation is ready typedef void ( * lv_anim_start_cb_t ) ( struct _lv_anim_t * ) ¶Ĭallback to call when the animation really stars (considering delay) typedef struct _lv_anim_t lv_anim_t ¶įunctions void _lv_anim_core_init ( void ) ¶ Might be used by binding generator functions. It's more consistent but less convenient. Same as lv_anim_exec_xcb_t but receives lv_anim_t * as the first parameter. Compatible with lv_xxx_set_yyy(obj, value) functions The x in _xcb_t means its not a fully generic prototype because it doesn't receive lv_anim_t * as its first argument typedef void ( * lv_anim_custom_exec_cb_t ) ( struct _lv_anim_t *, lv_anim_value_t ) ¶ First parameter is the variable to animate. Generic prototype of "animator" functions. Typedef void ( * lv_anim_exec_xcb_t ) ( void *, lv_anim_value_t ) ¶ Get the current value during an animation typedef struct _lv_anim_path_t lv_anim_path_t ¶ Type of the animated value typedef lv_anim_value_t ( * lv_anim_path_cb_t ) ( const struct _lv_anim_path_t *, const struct _lv_anim_t * ) ¶ Typedefs typedef uint8_t lv_anim_enable_t ¶ Therefore lv_anim_start() will delete the already existing variable-function animations. However, only one animation can exist with a given variable and function pair. You can apply multiple different animations on the same variable at the same time.įor example, animate the x and y coordinates with lv_obj_set_x and lv_obj_set_y. */ lv_anim_set_early_apply ( & a, true / false ) /* START THE ANIMATION *-*/ lv_anim_start ( & a ) /*Start the animation*/ Default is 0 (disabled) */ lv_anim_set_repeat_delay ( & a, wait_time ) /*true (default): apply the start vale immediately, false: apply start vale after delay when then anim. LV_ANIM_REPEAT_INFINIT for infinite repetition*/ lv_anim_set_repeat_count ( & a, wait_time ) /*Delay before repeat. Default is 0 (disabled) */ lv_anim_set_playback_delay ( & a, wait_time ) /*Number of repetitions. Default is 0 (disabled) */ lv_anim_set_playback_time ( & a, wait_time ) /*Delay before playback. Default is linear*/ lv_anim_set_path ( & a, & path ) /*Set a callback to call when animation is ready.*/ lv_anim_set_ready_cb ( & a, ready_cb ) /*Set a callback to call when animation is started (after delay).*/ lv_anim_set_start_cb ( & a, start_cb ) /*Play the animation backward too with this duration. 0, 150*/ lv_anim_set_values ( & a, start, end ) /* OPTIONAL SETTINGS *-*/ /*Time to wait before starting the animation */ lv_anim_set_delay ( & a, delay ) /*Set path (curve). * INITIALIZE AN ANIMATION *-*/ lv_anim_t a lv_anim_init ( & a ) /* MANDATORY SETTINGS *-*/ /*Set the "animator" function*/ lv_anim_set_exec_cb ( & a, ( lv_anim_exec_xcb_t ) lv_obj_set_x ) /*Set the variable to animate*/ lv_anim_set_var ( & a, obj ) /*Length of the animation */ lv_anim_set_time ( & a, duration ) /*Set start and end values. ![]()
0 Comments
Leave a Reply. |