M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
x, yfloatTop-left corner, in pixels. A vec2 also works.
width, heightfloatSize in pixels. A vec2 also works.
colorcolorColour, a tocolor value.default tocolor(255, 255, 255)
postGUIboolDraw on top of the interface.default false
subPixelPositioningboolKeep 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)

See also