BSB Developer Docs
Loading...
Searching...
No Matches
lv_label_ext.h File Reference

LVGL label extensions. More...

#include <lvgl.h>

Go to the source code of this file.

Functions

void lv_label_ext_set_anim_speed (lv_obj_t *label, uint32_t px_per_min)
 Set the scroll animation speed for a label.
 
void lv_label_ext_set_max_lines (lv_obj_t *label, uint32_t max_lines)
 Cap the label's height to N text lines.
 

Detailed Description

LVGL label extensions.

Function Documentation

◆ lv_label_ext_set_anim_speed()

void lv_label_ext_set_anim_speed ( lv_obj_t * label,
uint32_t px_per_min )

Set the scroll animation speed for a label.

The scroll distance is computed to match LVGL's internal scroll path.

Warning
Only valid for LV_LABEL_LONG_MODE_SCROLL_CIRCULAR.
Note
The distance is read from the label's self size cache, whose value depends on the current long mode: LV_LABEL_LONG_MODE_DOTS and LV_LABEL_LONG_MODE_WRAP cache a wrap-bounded width, yielding a too-short duration and an overly fast scroll. Call this only while the label is in an expand long mode (CLIP, SCROLL, SCROLL_CIRCULAR) — in practice, after lv_label_set_long_mode, not before.
Parameters
[in,out]labellabel lvgl object
[in]px_per_minscroll speed in pixels per minute (must be > 0)

◆ lv_label_ext_set_max_lines()

void lv_label_ext_set_max_lines ( lv_obj_t * label,
uint32_t max_lines )

Cap the label's height to N text lines.

Sets max_height to line_height * max_lines + line_space * (max_lines - 1), computed once at call time from the label's current font.

Parameters
[in,out]labellabel lvgl object
[in]max_linesmaximum number of text lines (must be > 0)