natiny.render.triangle
natiny.render.triangle(x0, y0, x1, y1, x2, y2)
Draws a filled triangle on the currently bound render target, using the current drawing color set by natiny.render.set_color().
Parameters
| Name | Type | 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 |
Example
natiny.render.triangle(160, 40, 100, 160, 220, 160)
Notes
- Vertices are submitted in the given order. Winding matters only when a bound custom material enables face culling.