Skip to content

lvgl.arc

lvgl.arc([parent, ]params)

Display an arc.

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
thicknessnumberwidth of the arc's line, defaults to 1
radiusnumber or functionradius of the arc, defaults to 0
startAnglenumber or functionstarting angle in degrees (0-360), 0 is 3 o'clock, defaults to 0
endAnglenumber or functionending angle in degrees, defaults to 360
opacitynumber or functionopacity from 0 (transparent) to 255 (opaque), defaults to 255
roundedbooleanif true the ends of the arc are rounded, defaults to false
bgColorcolor or functioncolor of the background arc, not used by default
bgOpacitynumber or functionopacity of the background arc, defaults to 0 (not visible)
bgStartAnglenumber or functionstarting angle of the background arc in degrees, defaults to 0
bgEndAnglenumber or functionending 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