natiny.render.poly

Lua
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

Lua
natiny.render.poly(160, 120, 6, 52, 0.0)

Notes

  • sides must be at least 3; smaller values draw nothing.
  • radius is measured from the center to a vertex and rotation is in degrees.