lvgl.rectangle
lvgl.rectangle([parent, ]params)
Display a rectangle. Based on lvgl.box, so all lvgl.box settings also apply.
Parameters
| Name | Req | Type | Description |
|---|
parent | no | object | 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 | thickness | number | width of the border line, defaults to 1 | filled | boolean or function | if true the rectangle is filled with color, defaults to false (function support added in 2.11.4) | rounded | number | if greater than 0, rounds the corners with this radius; must be >= thickness if set, defaults to 0 | opacity | number or function | opacity from 0 (transparent) to 255 (opaque), defaults to 255 |
|
Returns
| Name | Type | Description |
- | table | LVGL object |
Availability
- Since:
2.11.0 - Radio support:
color-lcd
Notes
- When used in a stand alone tool script, the rectangle automatically adds scroll bars if any child objects are placed outside its boundaries. For widgets, child objects outside the bounds are clipped instead.
Source
radio/src/lua/api_colorlcd_lvgl.cpp