Description
I am trying to create a label with some long text.
The text_long_mode is set to LV_LABEL_LONG_SCROLL.
I want to have some initial delay before scrolling starts, and also some delay before restarting the scrolling. Ideally, it would be great if setting the repeat count or other animation settings would be possible as well.
While searching this forum, I found this post:
https://forum.lvgl.io/t/how-to-customize-the-circular-scrolling-of-a-label/8011
which lead to a new feature for the LV_LABEL_LONG_SCROLL_CIRCULAR mode.
I tested this, and this works as expected for the circular scrolling.
However, this does not seem to be implemented for the normal scroll mode?
What MCU/Processor/Board and compiler are you using?
ESP32S3
What LVGL version are you using?
8.3.7, although also tested with 8.3.9
What do you want to achieve?
Setting animation settings (initial-/repeat- delay) of scrolling of a label with LV_LABEL_LONG_SCROLL mode.
What have you tried so far?
I tried with some simple code from examples (see below)
Code to reproduce
I took code from examples, and adapted it to use the LV_LABEL_LONG_SCROLL:
void lv_example_label_5(void)
{
static lv_anim_t animation_template;
static lv_style_t label_style;
lv_anim_init(&animation_template);
lv_anim_set_delay(&animation_template, 1000); /*Wait 1 second to start the first scroll*/
lv_anim_set_repeat_delay(&animation_template,
3000); /*Repeat the scroll 3 seconds after the label scrolls back to the initial position*/
/*Initialize the label style with the animation template*/
lv_style_init(&label_style);
lv_style_set_anim(&label_style, &animation_template);
lv_obj_t * label1 = lv_label_create(lv_scr_act());
lv_label_set_long_mode(label1, LV_LABEL_LONG_SCROLL); /*NORMAL scroll*/
lv_obj_set_width(label1, 150);
lv_label_set_text(label1, "It is a circularly scrolling text. ");
lv_obj_align(label1, LV_ALIGN_CENTER, 0, 40);
lv_obj_add_style(label1, &label_style, LV_STATE_DEFAULT); /*Add the style to the label*/
}
This works correctly when using LV_LABEL_LONG_SCROLL_CIRCULAR (as in original example). But does not work with LV_LABEL_LONG_SCROLL (animation settings ignored).