lv_arclabel.h

Defines

LV_ARCLABEL_DOT_NUM
LV_ARCLABEL_DEFAULT_TEXT

Enums

enum lv_arclabel_dir_t

Values:

enumerator LV_ARCLABEL_DIR_CLOCKWISE
enumerator LV_ARCLABEL_DIR_COUNTER_CLOCKWISE
enum lv_arclabel_text_align_t

Values:

enumerator LV_ARCLABEL_TEXT_ALIGN_DEFAULT
enumerator LV_ARCLABEL_TEXT_ALIGN_LEADING
enumerator LV_ARCLABEL_TEXT_ALIGN_CENTER
enumerator LV_ARCLABEL_TEXT_ALIGN_TRAILING

Functions

lv_obj_t *lv_arclabel_create(lv_obj_t *parent)

Create an arc label object

Parameters:

parent – pointer to an object, it will be the parent of the new arc label

Returns:

pointer to the created arc label

void lv_arclabel_set_text(lv_obj_t *obj, const char *text)

Set the text of the arc label.

This function sets the text displayed by an arc label object.

Parameters:
  • obj – Pointer to the arc label object.

  • text – Pointer to a null-terminated string containing the new text for the label.

void lv_arclabel_set_text_fmt (lv_obj_t *obj, const char *fmt,...) LV_FORMAT_ATTRIBUTE(2

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.

Parameters:
  • obj – The arc label object to set the text for.

  • fmt – A format string that specifies how subsequent arguments are converted to text.

  • ... – Arguments following the format string that are used to replace format specifiers in the format string.

void void lv_arclabel_set_text_static (lv_obj_t *obj, const char *text)

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.

Parameters:
  • obj – Pointer to the arc label object.

  • text – Pointer to the new text. If NULL, the label is refreshed with its current text.

void lv_arclabel_set_angle_start(lv_obj_t *obj, lv_value_precise_t start)

Set the start angle of an arc. 0 deg: right, 90 bottom, etc.

Parameters:
  • obj – pointer to an arc label object

  • start – the start angle. (if LV_USE_FLOAT is enabled it can be fractional too.)

void lv_arclabel_set_angle_size(lv_obj_t *obj, lv_value_precise_t size)

Set the end angle of an arc. 0 deg: right, 90 bottom, etc.

Parameters:
  • obj – pointer to an arc label object

  • size – the angle size (if LV_USE_FLOAT is enabled it can be fractional too.)

void lv_arclabel_set_offset(lv_obj_t *obj, int32_t offset)

Set the rotation for the whole arc

Parameters:
  • obj – pointer to an arc label object

  • offset – rotation angle

void lv_arclabel_set_dir(lv_obj_t *obj, lv_arclabel_dir_t dir)

Set the type of arc.

Parameters:
  • obj – pointer to and arc label object

  • dir – arc label's direction

void lv_arclabel_set_recolor(lv_obj_t *obj, bool en)

Enable the recoloring by in-line commands

Parameters:
  • obj – pointer to an arc label object

  • en – true: enable recoloring, false: disable Example: "This is a #ff0000 red# word"

void lv_arclabel_set_radius(lv_obj_t *obj, uint32_t radius)

Set the radius for an arc label object.

Parameters:
  • obj – pointer to the arc label object.

  • radius – The radius value to set for the label's curvature, in pixels.

void lv_arclabel_set_center_offset_x(lv_obj_t *obj, uint32_t x)

Set the center offset x for an arc label object.

Parameters:
  • obj – pointer to an arc label object

  • x – the x offset

void lv_arclabel_set_center_offset_y(lv_obj_t *obj, uint32_t y)

Set the center offset y for an arc label object.

Parameters:
  • obj – pointer to an arc label object

  • y – the y offset

void lv_arclabel_set_text_vertical_align(lv_obj_t *obj, lv_arclabel_text_align_t align)

Set the text vertical alignment for an arc label object.

Parameters:
  • obj – pointer to an arc label object

  • align – the vertical alignment

void lv_arclabel_set_text_horizontal_align(lv_obj_t *obj, lv_arclabel_text_align_t align)

Set the text horizontal alignment for an arc label object.

Parameters:
  • obj – pointer to an arc label object

  • align – the horizontal alignment

lv_value_precise_t lv_arclabel_get_angle_start(lv_obj_t *obj)

Get the start angle of an arc label.

Parameters:

obj – pointer to an arc label object

Returns:

the start angle [0..360] (if LV_USE_FLOAT is enabled it can be fractional too.)

lv_value_precise_t lv_arclabel_get_angle_size(lv_obj_t *obj)

Get the angle size of an arc label.

Parameters:

obj – pointer to an arc label object

Returns:

the end angle [0..360] (if LV_USE_FLOAT is enabled it can be fractional too.)

lv_arclabel_dir_t lv_arclabel_get_dir(const lv_obj_t *obj)

Get whether the arc label is type or not.

Parameters:

obj – pointer to an arc label object

Returns:

arc label's direction

bool lv_arclabel_get_recolor(lv_obj_t *obj)

Enable the recoloring by in-line commands

Parameters:

obj – pointer to a label object

Returns:

true: enable recoloring, false: disable

uint32_t lv_arclabel_get_radius(lv_obj_t *obj)

Get the text of the arc label.

Parameters:

obj – pointer to an arc label object

Returns:

the radius of the arc label

uint32_t lv_arclabel_get_center_offset_x(lv_obj_t *obj)

Get the center offset x for an arc label object.

Parameters:

obj – pointer to an arc label object

Returns:

the x offset

uint32_t lv_arclabel_get_center_offset_y(lv_obj_t *obj)

Get the center offset y for an arc label object.

Parameters:

obj – pointer to an arc label object

Returns:

the y offset

lv_arclabel_text_align_t lv_arclabel_get_text_vertical_align(lv_obj_t *obj)

Get the text vertical alignment for an arc label object.

Parameters:

obj – pointer to an arc label object

Returns:

the vertical alignment

lv_arclabel_text_align_t lv_arclabel_get_text_horizontal_align(lv_obj_t *obj)

Get the text horizontal alignment for an arc label object.

Parameters:

obj – pointer to an arc label object

Returns:

the horizontal alignment

Variables

const lv_obj_class_t lv_arclabel_class