dxDrawMaterialPrimitive
Cliente
Dibuja una primitiva 2D con una imagen en la pantalla durante un fotograma.
bool dxDrawMaterialPrimitive(string primitiveType, texture|dui|string material, bool postGUI, table vertex1, vertex2, ...)
Parámetros
| Nombre | Tipo | Descripción |
|---|---|---|
| primitiveType | string | Tipo de primitiva: pointlist, linelist, linestrip, trianglelist, trianglestrip o trianglefan. |
| material | texture|dui|string | La imagen (textura, render target, screen source o dui) o la ruta de un archivo de imagen del recurso. |
| postGUI | bool | Dibuja por encima de la interfaz. |
| vertex1, vertex2, ... | table | Un argumento por vértice: {x, y, u, v} o {x, y, color, u, v}, con la posición en píxeles y u, v las coordenadas en la imagen. |
Retorno
true si el dibujo quedó en cola. false cuando la cantidad de vértices no sirve para el tipo (por ejemplo, trianglelist necesita un múltiplo de 3). También false si la imagen no se pudo cargar.
Ejemplo
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)