dxDrawMaterialPrimitive
Client
Draws a 2D primitive with an image on the screen for one frame.
bool dxDrawMaterialPrimitive(string primitiveType, texture|dui|string material, bool postGUI, table vertex1, vertex2, ...)
Parameters
| Name | Type | Description |
|---|---|---|
| primitiveType | string | Primitive type: pointlist, linelist, linestrip, trianglelist, trianglestrip or trianglefan. |
| material | texture|dui|string | The image (a texture, render target, screen source or dui) or the path of an image file in the resource. |
| postGUI | bool | Draw on top of the interface. |
| vertex1, vertex2, ... | table | One argument per vertex: {x, y, u, v} or {x, y, color, u, v}, the position in pixels and u, v the coordinates in the image. |
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). Also false when the image could not be loaded.
Example
local tex = engineCreateTexture("images/panel.png")
addEventHandler("onClientRender", root, function()
dxDrawMaterialPrimitive("trianglestrip", tex, false,
{ 100, 100, 0, 0 },
{ 300, 100, 1, 0 },
{ 100, 200, 0, 1 },
{ 300, 200, 1, 1 })
end)