- Documentation
- Client functions
- dxDrawPrimitive
Function
dxDrawPrimitive
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)