lvgl.arc
lvgl.arc([parent, ]params)
Display an arc.
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 arc's line, defaults to 1 | radius | number or function | radius of the arc, defaults to 0 | startAngle | number or function | starting angle in degrees (0-360), 0 is 3 o'clock, defaults to 0 | endAngle | number or function | ending angle in degrees, defaults to 360 | opacity | number or function | opacity from 0 (transparent) to 255 (opaque), defaults to 255 | rounded | boolean | if true the ends of the arc are rounded, defaults to false | bgColor | color or function | color of the background arc, not used by default | bgOpacity | number or function | opacity of the background arc, defaults to 0 (not visible) | bgStartAngle | number or function | starting angle of the background arc in degrees, defaults to 0 | bgEndAngle | number or function | ending angle of the background arc in degrees, defaults to 360 |
|
Returns
| Name | Type | Description |
- | table | LVGL object |
Availability
- Since:
2.11.0 - Radio support:
color-lcd
Notes
- Arc objects have two elements, a foreground arc and a background arc. By default the background arc is not shown -- to show it, set both
bgColor and bgOpacity. @notice If opacity or bgOpacity is less than 255 and rounded is true, the ends of the arc will not draw correctly. This is an LVGL limitation.
Source
radio/src/lua/api_colorlcd_lvgl.cpp