Hello everyone! I’m pretty much new here and LVGL. Working on making a small gauge screen inspired by Garage Tinkering on youtube. I faced a problem though which i think is a bug. I have a separate section for my RPM scale, which is my redline.
lv_scale_section_t* section = lv_scale_add_section(rpm_arc);
lv_scale_set_section_range(rpm_arc, section, (maxRPM * 1000) - 2000, maxRPM * 1000);
lv_scale_set_section_style_indicator(rpm_arc, section, §ion_label_style);
lv_scale_set_section_style_items(rpm_arc, section, §ion_minor_tick_style);
Problem occurs after my splash screen finishes and this one loads up. The section doesn’t fade in. Also noticed that if i use
lv_obj_set_style_opa(rpm_arc, 0, LV_PART_INDICATOR);
lv_obj_set_style_opa(rpm_arc, 0, LV_PART_ITEMS);
It won’t affect them as well(so i could ‘hack’ them this way with animation).
I’m running it on the simulator with the latest version.
After searching every single function i found that these work!
static void line_opacity_anim(void* var, int32_t v) {
lv_style_set_line_opa((lv_style_t*)var, v);
}
static void text_opacity_anim(void* var, int32_t v) {
lv_style_set_text_opa((lv_style_t*)var, v);
}
So here’s my hacking code. If somebody knows a better “native” work, go on!
//HACK ANIMATION
lv_anim_t tick_anim;
lv_anim_init(&tick_anim);
lv_anim_set_var(&tick_anim, §ion_minor_tick_style);
lv_anim_set_duration(&tick_anim, BLEND_TIME);
lv_anim_set_values(&tick_anim, 0, 255);
lv_anim_set_exec_cb(&tick_anim, line_opacity_anim);
lv_anim_start(&tick_anim);
lv_anim_t label_anim;
lv_anim_init(&label_anim);
lv_anim_set_var(&label_anim, §ion_label_style);
lv_anim_set_duration(&label_anim, BLEND_TIME);
lv_anim_set_values(&label_anim, 0, 255);
lv_anim_set_exec_cb(&label_anim, line_opacity_anim);
lv_anim_start(&label_anim);
lv_anim_t text_anim;
lv_anim_init(&text_anim);
lv_anim_set_var(&text_anim, §ion_label_style);
lv_anim_set_duration(&text_anim, BLEND_TIME);
lv_anim_set_values(&text_anim, 0, 255);
lv_anim_set_exec_cb(&text_anim, text_opacity_anim);
lv_anim_start(&text_anim);