dxDrawRectangle
Client
Draws a filled rectangle on the screen for one frame.
bool dxDrawRectangle(float x, y, float width, height [, color color = tocolor(255, 255, 255), bool postGUI = false, bool subPixelPositioning = false])
Parameters
| Name | Type | Description |
|---|---|---|
| x, y | float | Top-left corner, in pixels. A vec2 also works. |
| width, height | float | Size in pixels. A vec2 also works. |
| color | color | Colour, a tocolor value.default tocolor(255, 255, 255) |
| postGUI | bool | Draw on top of the interface.default false |
| subPixelPositioning | bool | Keep fractional positions instead of snapping to whole pixels.default false |
Returns
true once the drawing is queued.
Example
local sx, sy = getScreenSize()
addEventHandler("onClientRender", root, function()
dxDrawRectangle(sx - 220, 20, 200, 60, tocolor(0, 0, 0, 160))
end)