natiny.render.poly
natiny.render.poly(cx, cy, sides, radius [, rotation])
Draws a filled regular polygon on the currently bound render target, using the current drawing color set by natiny.render.set_color().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cx |
number |
Center X position | |
cy |
number |
Center Y position | |
sides |
integer |
Number of polygon sides | |
radius |
number |
Distance from the center to a vertex | |
rotation |
number |
0.0 |
Rotation angle in degrees |
Example
natiny.render.poly(160, 120, 6, 52, 0.0)
Notes
sidesmust be at least 3; smaller values draw nothing.radiusis measured from the center to a vertex androtationis in degrees.