Description
What is the preffered way to make an animation for something to be blinking but not a led.
So technically i want to make something visible and not visible.
Can it be done using the LV_OBJ_FLAG_HIDDEN to be add or clear?
Or to use the opacity
What MCU/Processor/Board and compiler are you using?
esp32, simulator
What LVGL version are you using?
8.3
What do you want to achieve?
Animation of a blinking object, shown/hidden/shown/hidden
What have you tried so far?
Tried to make an animation by using the add/clear flag but it did not work ,
i was trying to use the playback in order to revert the value but it did not do anything.
Is there any example that someone does flag control on animation?
I have also tried the opa which works fine but i get in console that i do not know what it is. Can someone help?
Code
void str_string_line_animator(ButtonTask animSelector,bool startAnim){
lv_anim_t* anim;
lv_obj_t* obj;
switch (animSelector) {
case MAINS:
anim = &mainsAnim;
obj=mainStrings;
break;
case CROSSES:
anim = &crossesAnim;
obj=crossStrings;
break;
default:
break;
}
if(startAnim){
lv_anim_init(anim);
lv_anim_set_var(anim, obj);
lv_anim_set_values(anim, LV_OPA_TRANSP, LV_OPA_COVER);
lv_anim_set_time(anim, 500);
lv_anim_set_playback_delay(anim, 500);
lv_anim_set_playback_time(anim, 500);
lv_anim_set_repeat_count(anim, LV_ANIM_REPEAT_INFINITE);
lv_anim_set_exec_cb(anim, anim_flash);
lv_anim_start(anim);
}else{
lv_anim_del(obj, anim_flash);
}
}
static void anim_flash(void * var, int32_t v)
{
lv_obj_set_style_opa(var, v, 0);
}
### Console log.
[Warn] (11.493, +36) lv_draw_sw_layer_create: Rendering this widget needs LV_COLOR_SCREEN_TRANSP 1 (in lv_draw_sw_layer.c line #47)
[Warn] (11.493, +0) refr_obj: Couldn't create a new layer context (in lv_refr.c line #909)