dxDrawMaterialPrimitive
Cliente
Desenha uma primitiva 2D com uma imagem na tela durante um quadro.
bool dxDrawMaterialPrimitive(string primitiveType, texture|dui|string material, bool postGUI, table vertex1, vertex2, ...)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
| primitiveType | string | Tipo de primitiva: pointlist, linelist, linestrip, trianglelist, trianglestrip ou trianglefan. |
| material | texture|dui|string | A imagem (textura, render target, screen source ou dui) ou o caminho de um arquivo de imagem do recurso. |
| postGUI | bool | Desenha por cima da interface. |
| vertex1, vertex2, ... | table | Um argumento por vértice: {x, y, u, v} ou {x, y, color, u, v}, com a posição em pixels e u, v as coordenadas na imagem. |
Retorno
true se o desenho foi enfileirado. false quando a quantidade de vértices não serve para o tipo (por exemplo, trianglelist precisa de um múltiplo de 3). Também false se a imagem não pôde ser carregada.
Exemplo
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)