M MY Multiplayer: Wiki
Side
Kind

dxDrawPrimitive

Client

Draws a 2D primitive (points, lines or triangles) on the screen for one frame.

bool dxDrawPrimitive(string primitiveType, bool postGUI, table vertex1, vertex2, ...)

Parameters

NameTypeDescription
primitiveTypestringPrimitive type: pointlist, linelist, linestrip, trianglelist, trianglestrip or trianglefan.
postGUIboolDraw on top of the interface.
vertex1, vertex2, ...tableOne argument per vertex: {x, y} or {x, y, color}, in pixels, the colour a tocolor value.

Returns

true once the drawing is queued. false when the number of vertices does not fit the type (for example, trianglelist needs a multiple of 3).

Example

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

See also