lvgl.rectangle
Display a text label.
Syntax
lvgl.rectangle([parent], {settings})
parent:rectangle({settings})
Parameters
See the API page for parameter description and common settings.
Rectangle specific settings:
thickness
Number
Sets the width of the line used to draw the border.
1
filled
Boolean
If true the rectangle is filled with the 'color' value.
false
rounded
Number
If greater than 0 makes the corners rounded with a radius set this value. When set to a value greater than 0, must also be >= thickness.
0
opacity
Number or Function
Sets the opacity. Note: range is 0 (transparent) to 255 (opaque)
255 (opaque)
scrollBar
Boolean
Sets the allowed scrolling directions if child objects extend beyond the box boundaries. Only valid for stand alone scripts.
true
scrollDir
Scroll type - lvgl.SCROLL_xx
Sets the allowed scrolling directions if child objects extend beyond the rectangle boundaries. Only valid for stand alone scripts.
lvgl.SCROLL_ALL
scrolled
Function
Called when the box content is scrolled. Passed two parameters 'x', and 'y' which are the current scroll position of the box window.
nil
scrollTo
Function
Function to override the box scroll position. Must return two values, 'x' and 'y' which are the position to scroll the box window to.
nil
Notes
When used in a stand alone tool script, the rectangle will automatically add scroll bars if any child objects are placed outside of the rectangle boundaries. For widgtes, child objects outside the rectangle bounds will be clipped.
Return values
LVGL object
API Status
BW radios
Color radios
Change log
2.11.0
Introduced
Last updated
Was this helpful?