M MY Multiplayer: Wiki
Side
Kind

drawDui

Client

Draws a dui on the screen for one frame, in coordinates relative to the screen.

bool drawDui(dui dui, float x, float y, float width, float height)

Parameters

NameTypeDescription
duiduiThe dui.
xfloatLeft edge, from 0 to 1 of the screen's width.
yfloatTop edge, from 0 to 1 of the screen's height.
widthfloatWidth, as a fraction of the screen's width.
heightfloatHeight, as a fraction of the screen's height.

Returns

true once the drawing is asked for. false with a wrong argument (logs a warning).

Call it every frame while the dui should show. To draw in pixels, use dxDrawImage with the dui.

Example

local dui = createDui("https://example.com", 1280, 720)

addEventHandler("onClientRender", root, function()
    drawDui(dui, 0.7, 0.05, 0.25, 0.25)
end)

See also