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
| Name | Type | Description |
|---|---|---|
| primitiveType | string | Primitive type: pointlist, linelist, linestrip, trianglelist, trianglestrip or trianglefan. |
| postGUI | bool | Draw on top of the interface. |
| vertex1, vertex2, ... | table | One 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)