natiny.render.triangle_outline

Lua
natiny.render.triangle_outline(x0, y0, x1, y1, x2, y2 [, thickness])

Draws a triangle outline on the currently bound render target, using the current drawing color set by natiny.render.set_color().

Parameters

Name Type Default Description
x0 number First vertex X position
y0 number First vertex Y position
x1 number Second vertex X position
y1 number Second vertex Y position
x2 number Third vertex X position
y2 number Third vertex Y position
thickness number 1.0 Outline thickness

Example

Lua
natiny.window.bind(win)
natiny.render.set_color(0.0, 1.0, 1.0, 1.0)
natiny.render.triangle_outline(160, 40, 100, 160, 220, 160, 2.0)
natiny.window.unbind()

Notes

  • Uses the color previously set by natiny.render.set_color(). The default is opaque white.
  • Draws to the render target most recently bound with natiny.window.bind() or natiny.surface.bind().