Draft: New HUD functions
Adds drawRectangle
, drawLine
, drawTriangle
, drawQuad
, and drawPolygon
to Lua.
Parameters:
drawRectangle(fixed x, fixed y, fixed w, fixed h, color+flags)
drawLine(fixed x1, fixed y1, fixed x2, fixed y2, color+flags)
drawTriangle(fixed x1, fixed y1, fixed x2, fixed y2, fixed x3, fixed y3, color+flags)
drawQuad(fixed x1, fixed y1, fixed x2, fixed y2, fixed x3, fixed y3, fixed x4, fixed y4, color+flags)
drawPolygon(table vertices, color+flags)
drawPolygon
table format:
-- x and y are fixed point coordinates
local vertices = {
{ x = num, y = num },
{ x = num, y = num },
-- (...)
{ x = num, y = num }
}
v.drawPolygon(vertices, 181)
-- or
vertices = {
{ num, num },
{ num, num },
-- (...)
{ num, num }
}
v.drawPolygon(vertices, 181)
Also adds vector2
and vector3
libraries
Examples:
Edited by Lactozilla