dxDrawCircle
Client
Draws a filled circle, or a slice of one, on the screen for one frame.
bool dxDrawCircle(float x, y, float radius [, float startAngle = 0, float stopAngle = 360, color color = tocolor(255, 255, 255), color centerColor = color, int segments = 32, float ratio = 1, bool postGUI = false])
Parameters
| Name | Type | Description |
|---|---|---|
| x, y | float | Centre, in pixels. A vec2 also works. |
| radius | float | Radius in pixels. |
| startAngle | float | Start angle in degrees. 0 points right and the angle grows clockwise.default 0 |
| stopAngle | float | Stop angle in degrees. The two angles are swapped when reversed, and the slice covers at most 360°.default 360 |
| color | color | Edge colour, a tocolor value.default tocolor(255, 255, 255) |
| centerColor | color | Centre colour, blended out to the edge.default color |
| segments | int | Number of segments, from 3 to 1024.default 32 |
| ratio | float | Width over height, for ellipses. Above 0 and up to 100.default 1 |
| postGUI | bool | Draw on top of the interface.default false |
Returns
true once the drawing is queued. false when segments is outside 3 to 1024, ratio outside 0 to 100, radius is not positive or the angles are equal.
Example
local sx, sy = getScreenSize()
addEventHandler("onClientRender", root, function()
local health = getElementHealth(localPlayer)
dxDrawCircle(sx - 60, sy - 60, 40, 0, 360 * health / 100, tocolor(200, 40, 40, 220))
end)