lv_arclabel.h
API reference for lv_arclabel.h
Functions
lv_arclabel_set_text
Set the text of the arc label.
This function sets the text displayed by an arc label object.
void lv_arclabel_set_text(lv_obj_t *obj, const char *text)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | Pointer to the arc label object. |
text | const char * | Pointer to a null-terminated string containing the new text for the label. May be NULL. When NULL the label is refreshed with its current text. |
lv_arclabel_set_text_fmt
Set the formatted text of an arc label object.
This function sets the text of an arc label object with support for variable arguments formatting, similar to printf.
void lv_arclabel_set_text_fmt(lv_obj_t *obj, const char *fmt,...)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | The arc label object to set the text for. |
fmt | const char * | A format string that specifies how subsequent arguments are converted to text. May be NULL. When NULL the label is only refreshed. |
... |
lv_arclabel_set_text_static
Sets a new static text for the arc label or refreshes it with the current text. The 'text' must remain valid in memory; the arc label does not manage its lifecycle.
void lv_arclabel_set_text_static(lv_obj_t *obj, const char *text)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | Pointer to the arc label object. |
text | const char * | Pointer to the new text. May be NULL. When NULL the current text is dropped. |
lv_arclabel_set_angle_start
Set the start angle of an arc. 0 deg: right, 90 bottom, etc.
void lv_arclabel_set_angle_start(lv_obj_t *obj, lv_value_precise_t start)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
start | lv_value_precise_t | the start angle. (if LV_USE_FLOAT is enabled it can be fractional too.) |
lv_arclabel_set_angle_size
Set the end angle of an arc. 0 deg: right, 90 bottom, etc.
void lv_arclabel_set_angle_size(lv_obj_t *obj, lv_value_precise_t size)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
size | lv_value_precise_t | the angle size (if LV_USE_FLOAT is enabled it can be fractional too.) |
lv_arclabel_set_offset
Set the rotation for the whole arc
void lv_arclabel_set_offset(lv_obj_t *obj, int32_t offset)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
offset | int32_t | rotation angle |
lv_arclabel_set_dir
Set the type of arc.
void lv_arclabel_set_dir(lv_obj_t *obj, lv_arclabel_dir_t dir)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to and arc label object |
dir | lv_arclabel_dir_t | arc label's direction |
lv_arclabel_set_recolor
Enable the recoloring by in-line commands
void lv_arclabel_set_recolor(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
en | bool | true: enable recoloring, false: disable Example: "This is a #ff0000 red# word" |
lv_arclabel_set_radius
Set the radius for an arc label object.
void lv_arclabel_set_radius(lv_obj_t *obj, uint32_t radius)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the arc label object. |
radius | uint32_t | The radius value to set for the label's curvature, in pixels. |
lv_arclabel_set_center_offset_x
Set the center offset x for an arc label object.
void lv_arclabel_set_center_offset_x(lv_obj_t *obj, uint32_t x)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
x | uint32_t | the x offset |
lv_arclabel_set_center_offset_y
Set the center offset y for an arc label object.
void lv_arclabel_set_center_offset_y(lv_obj_t *obj, uint32_t y)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
y | uint32_t | the y offset |
lv_arclabel_set_text_vertical_align
Set the text vertical alignment for an arc label object.
void lv_arclabel_set_text_vertical_align(lv_obj_t *obj, lv_arclabel_text_align_t align)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
align | lv_arclabel_text_align_t | the vertical alignment |
lv_arclabel_set_text_horizontal_align
Set the text horizontal alignment for an arc label object.
void lv_arclabel_set_text_horizontal_align(lv_obj_t *obj, lv_arclabel_text_align_t align)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
align | lv_arclabel_text_align_t | the horizontal alignment |
lv_arclabel_set_overflow
Set the overflow behavior for an arc label object.
void lv_arclabel_set_overflow(lv_obj_t *obj, lv_arclabel_overflow_t overflow)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
overflow | lv_arclabel_overflow_t | the overflow mode (visible, ellipsis, clip) |
lv_arclabel_set_end_overlap
Set the end overlap behavior for an arc label object. This controls how text is handled when it would overlap at the end of a 360-degree arc.
void lv_arclabel_set_end_overlap(lv_obj_t *obj, bool overlap)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
overlap | bool | set the arc label's end overlap behavior |
lv_arclabel_get_angle_start
Get the start angle of an arc label.
lv_value_precise_t lv_arclabel_get_angle_start(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: lv_value_precise_t — the start angle [0..360] (if LV_USE_FLOAT is enabled it can be fractional too.)
lv_arclabel_get_angle_size
Get the angle size of an arc label.
lv_value_precise_t lv_arclabel_get_angle_size(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: lv_value_precise_t — the end angle [0..360] (if LV_USE_FLOAT is enabled it can be fractional too.)
lv_arclabel_get_dir
Get whether the arc label is type or not.
lv_arclabel_dir_t lv_arclabel_get_dir(const lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | const lv_obj_t * | pointer to an arc label object |
Returns: lv_arclabel_dir_t — arc label's direction
lv_arclabel_get_recolor
Enable the recoloring by in-line commands
bool lv_arclabel_get_recolor(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a label object |
Returns: bool — true: enable recoloring, false: disable
See also: lv_arclabel_set_recolor
lv_arclabel_get_radius
Get the text of the arc label.
uint32_t lv_arclabel_get_radius(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: uint32_t — the radius of the arc label
lv_arclabel_get_center_offset_x
Get the center offset x for an arc label object.
uint32_t lv_arclabel_get_center_offset_x(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: uint32_t — the x offset
lv_arclabel_get_center_offset_y
Get the center offset y for an arc label object.
uint32_t lv_arclabel_get_center_offset_y(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: uint32_t — the y offset
lv_arclabel_get_text_vertical_align
Get the text vertical alignment for an arc label object.
lv_arclabel_text_align_t lv_arclabel_get_text_vertical_align(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: lv_arclabel_text_align_t — the vertical alignment
lv_arclabel_get_text_horizontal_align
Get the text horizontal alignment for an arc label object.
lv_arclabel_text_align_t lv_arclabel_get_text_horizontal_align(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: lv_arclabel_text_align_t — the horizontal alignment
lv_arclabel_get_overflow
Get the overflow behavior for an arc label object.
lv_arclabel_overflow_t lv_arclabel_get_overflow(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: lv_arclabel_overflow_t — the overflow mode
lv_arclabel_get_end_overlap
Get the end overlap behavior for an arc label object.
bool lv_arclabel_get_end_overlap(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: bool — the end overlap mode
lv_arclabel_get_text_angle
Get the text angle for an arc label object.
lv_value_precise_t lv_arclabel_get_text_angle(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an arc label object |
Returns: lv_value_precise_t — the text angle (if LV_USE_FLOAT is enabled it can be fractional too.)
The text angle is calculated at runtime. You can get the updated value after the arclabel's size has been updated. Returns the real rendered text angle in degrees except in LV_ARCLABEL_OVERFLOW_VISIBLE mode.
lv_arclabel_create
Create an arc label object
lv_obj_t * lv_arclabel_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a parent widget May be NULL.. When NULL, the widget is created as a screen on the default display. |
Returns: lv_obj_t * — pointer to the created arc label
Enums
lv_arclabel_dir_t
| Name | Value |
|---|---|
LV_ARCLABEL_DIR_CLOCKWISE | 0 |
LV_ARCLABEL_DIR_COUNTER_CLOCKWISE | 1 |
Used by 1 function
lv_arclabel_set_dir— paramdir
lv_arclabel_text_align_t
| Name | Value |
|---|---|
LV_ARCLABEL_TEXT_ALIGN_DEFAULT | 0 |
LV_ARCLABEL_TEXT_ALIGN_LEADING | 1 |
LV_ARCLABEL_TEXT_ALIGN_CENTER | 2 |
LV_ARCLABEL_TEXT_ALIGN_TRAILING | 3 |
Used by 2 functions
lv_arclabel_set_text_vertical_align— paramalignlv_arclabel_set_text_horizontal_align— paramalign
lv_arclabel_overflow_t
| Name | Description |
|---|---|
LV_ARCLABEL_OVERFLOW_VISIBLE | Show full text, may overflow object area |
LV_ARCLABEL_OVERFLOW_ELLIPSIS | Show ellipsis (...) when text overflows |
LV_ARCLABEL_OVERFLOW_CLIP | Clip text at arc boundary |
Used by 1 function
lv_arclabel_set_overflow— paramoverflow
Macros
LV_ARCLABEL_DOT_NUM
#define LV_ARCLABEL_DOT_NUM 3LV_ARCLABEL_DEFAULT_TEXT
#define LV_ARCLABEL_DEFAULT_TEXT "Arced Text"Variables
lv_arclabel_class
const lv_obj_class_t lv_arclabel_classDependencies
Last updated on