# dxDrawCircle (Client)

> Draws a filled circle, or a slice of one, on the screen for one frame.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Screen drawing
- **URL**: https://wiki.mymp.gg/en/dxDrawCircle

## Syntax

```lua
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

```lua
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)
```

## See also

- [dxDrawRectangle (Client)](https://wiki.mymp.gg/en/dxDrawRectangle.md): Draws a filled rectangle on the screen for one frame.
- [dxDrawPrimitive (Client)](https://wiki.mymp.gg/en/dxDrawPrimitive.md): Draws a 2D primitive (points, lines or triangles) on the screen for one frame.
- [tocolor (Shared)](https://wiki.mymp.gg/en/tocolor.md): Packs a colour's components into a single ARGB number. It is the same function as rgb.
