ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. dxSetDrawPriority

Function

dxSetDrawPriority

ClientDrawing (dx)Trilogy Hub only

Sets whether the resource's normal 2D drawings (dxDrawRectangle, dxDrawText, dxDrawImage, dxDrawLine and others without postGUI) are drawn above the game HUD and radar ("overHud", the default) or below them ("underHud"). The setting applies to the resource's next dxDraw* calls and stays until changed; every resource has its own. You can switch inside one onClientRender: some drawings below the HUD, some above it. Drawings with postGUI = true are always on top of everything.

Syntax

bool dxSetDrawPriority(string priority)

Arguments

prioritystring
"overHud" or "underHud".

Returns

true, or false for a wrong value.

Example

addEventHandler("onClientRender", root, function()
    local sw, sh = guiGetScreenSize()
    dxSetDrawPriority("underHud")
    dxDrawRectangle(0, sh - 300, 400, 300, tocolor(0, 0, 0, 150))   -- tlo pod radarem
    dxSetDrawPriority("overHud")
    dxDrawText("Nad HUD", 20, 20)
end)

See also