Skip to content

lvgl.label

lvgl.label([parent, ]params)

Display a text label.

Parameters

NameReqTypeDescription
parentnoobjectoptional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
paramsyestable
FieldTypeDescription
xnumberposition relative to the top-left of the parent
ynumberposition relative to the top-left of the parent
wnumberwidth
hnumberheight
colorcolor or functionprimary color for the object
posfunctiondynamic position callback returning x, y
sizefunctiondynamic size callback returning w, h
visiblefunctiondynamic visibility callback
floatingbooleankeep the object fixed inside a scrollable container, added in 2.11.6, defaults to false
textstring or functiontext to display, defaults to an empty string
fontfont value or functionsets the font size, e.g. MIDSIZE, DBLSIZE; defaults to STDSIZE
aligntext alignment value or functionsets the text justification, e.g. RIGHT, VCENTER; defaults to LEFT. RIGHT/CENTER require w to be set. LEFT/RIGHT/CENTER align text horizontally within the label's bounding box (x,y,w,h); VCENTER/VTOP/VBOTTOM align the label's bounding box vertically within the parent object

Returns

Name Type Description
- table LVGL object

Availability

  • Since: 2.11.0
  • Radio support: color-lcd

Source

radio/src/lua/api_colorlcd_lvgl.cpp