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

Function

dxDrawPrimitive

ClientDrawing (dx)Identical to MTA:SA

Draws a 2D shape from a list of {x, y [, color]} vertices: points, lines or triangles. The colour is blended smoothly between vertices.

Syntax

bool dxDrawPrimitive(string primitiveType, bool postGUI, table vertex1 [, table ...])

Arguments

primitiveTypestring
"pointlist", "linelist", "linestrip", "trianglelist", "trianglestrip", "trianglefan".
postGUIbool
Above GUI.
vertex1table
A vertex {x, y, color}.
...table, optional
More vertices.

Returns

true if drawn.

Example

addEventHandler("onClientRender", root, function()
    dxDrawPrimitive("trianglelist", false,
        { 300, 100, tocolor(255, 0, 0) },
        { 400, 250, tocolor(0, 255, 0) },
        { 200, 250, tocolor(0, 0, 255) })
end)

See also