drawCircle
Draws an unfilled circle outline around a specific center point.
Signature
Section titled “Signature”ui.drawCircle(center, radius, color, segments, thickness)Description
Section titled “Description”This function renders the outline of a circle. The smoothness of the circle depends on the number of segments used to draw it.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
center | vec2 | Yes | - | Screen coordinates for the center of the circle. |
radius | number | Yes | - | The radius of the circle in pixels. |
color | rgbm | Yes | - | The color and opacity of the outline. |
segments | integer | No | 0 (Auto) | The number of vertices used to draw the circle. Higher values result in smoother curves. |
thickness | number | No | 1.0 | The width of the outline stroke in pixels. |
Return Values
Section titled “Return Values”- None
Examples
Section titled “Examples”Draw a standard white circle.
local center = vec2(100, 100)local radius = 50
-- draw a white circle with default smoothnessui.drawCircle(center, radius, rgbm.colors.white)By lowering the segment count, you can create regular polygons.
local center = vec2(200, 100)local radius = 50
-- 6 segments creates a hexagonui.drawCircle(center, radius, rgbm.colors.red, 6, 3.0)