Skip to content

Spinner, Line & Shapes ​

spinner ​

Rotating arc loading indicator.

lua
ui:element({
    id = "loading", type = "spinner",
    rect = { unit = "px", x = 10, y = 10, w = 40, h = 40 },
    style = { color = "#38BDF8", thickness = 4 },
})
StyleDescription
colorArc color (default accent blue)
track_colorBackground track color
thicknessArc thickness in pixels (default 4)
arc_lengthFraction of full circle (default 0.3)
speedRotations per second (default 2)

line ​

A line between two points. Element rect is ignored — positioning via props.

lua
ui:element({
    id = "sep", type = "line",
    rect = { unit = "px", x = 0, y = 0, w = 0, h = 0 },
    props = { x1 = "10", y1 = "50", x2 = "200", y2 = "50" },
    style = { color = "#334155", thickness = "2" },
})
PropDescription
x1, y1Start point
x2, y2End point
StyleDescription
colorLine color (default white)
thicknessThickness in pixels (default 2)

rect_outline / border ​

Outline-only rectangle (no fill).

StyleDescription
colorOutline color
thicknessBorder thickness in pixels (default 2, same as Unity Outline distance)

circle ​

Filled ellipse (inscribed in rect) or elliptical outline ring. The renderer uses a mesh Graphic, not a square Image, so equal w/h gives a true circle. Fill vs stroke is controlled by props.filled, not by thickness.

lua
-- Filled (default): use style.bg for the fill color (style.color is ignored)
ui:element({
    id = "led",
    type = "circle",
    rect = { unit = "px", x = 100, y = 100, w = 50, h = 50 },
    style = { bg = "#B36200" },
})

-- Outline only: set filled to false; use style.color and style.thickness
ui:element({
    id = "ring",
    type = "circle",
    rect = { unit = "px", x = 160, y = 100, w = 50, h = 50 },
    props = { filled = false },
    style = { color = "#B36200", thickness = 3 },
})
PropDescription
filledOmit, empty, true, or 1 for filled disk (default). false or 0 for outline only.
StyleModeDescription
bgFilledFill tint (default white).
colorOutlineStroke color when filled is false (default white).
thicknessOutlineUnity Outline distance in pixels (default 2).

⚠️ This documentation was AI-generated and may contain inaccuracies. Please submit pull requests with corrections as needed.