optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
params
yes
table
Field
Type
Description
x
number
position relative to the top-left of the parent
y
number
position relative to the top-left of the parent
w
number
width
h
number
height
color
color or function
primary color for the object
pos
function
dynamic position callback returning x, y
size
function
dynamic size callback returning w, h
visible
function
dynamic visibility callback
floating
boolean
keep the object fixed inside a scrollable container, added in 2.11.6, defaults to false
text
string or function
text to display, defaults to an empty string
font
font value or function
sets the font size, e.g. MIDSIZE, DBLSIZE; defaults to STDSIZE
align
text alignment value or function
sets 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