Description
In the label I have text that scrolls from the bottom to the top. The label has the mode set to lv_label_set_long_mode(ui_Label1, LV_LABEL_LONG_SCROLL_CIRCULAR); I’m looking for a way to stop scrolling after pressing the button and after pressing the button again continue scrolling from the place where the text stopped
What MCU/Processor/Board and compiler are you using?
ESP32-S3
What LVGL version are you using?
8.3
What do you want to achieve?
I want to stop the text scrolling after pressing the button in the event handler and continue scrolling the text after pressing it again
What have you tried so far?
I tried setting the scroll speed to 0 but it doesn’t work
lv_obj_set_style_anim_speed(ui_Label1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
I tried to stop the scrolling and start it again. The problem is that the scrolling starts from the beginning and not from where it stopped
if (lv_obj_has_flag(ui_Image3, LV_OBJ_FLAG_HIDDEN))
{
lv_anim_del(ui_Label1, NULL); // Zatrzymanie animacji
}
else
{
lv_label_set_long_mode(ui_Label1, LV_LABEL_LONG_SCROLL_CIRCULAR);
}
Code to reproduce
ui_event_Panel1(lv_event_t * e)
{
lv_event_code_t event_code = lv_event_get_code(e);
if(event_code == LV_EVENT_CLICKED)
{
if (lv_obj_has_flag(ui_Image1, LV_OBJ_FLAG_HIDDEN))
{
lv_anim_del(ui_Label1, NULL);
}
else
{
lv_label_set_long_mode(ui_Label1, LV_LABEL_LONG_SCROLL_CIRCULAR);
}
_ui_flag_modify(ui_Image1, LV_OBJ_FLAG_HIDDEN, _UI_MODIFY_FLAG_TOGGLE);
}
}