natiny.render.rectangle
natiny.render.rectangle(x, y, w, h)
Draws a filled rectangle on the currently bound render target, using the current drawing color set by natiny.render.set_color().
Parameters
| Name | Type | Description |
|---|---|---|
x |
number |
Left edge X position |
y |
number |
Top edge Y position |
w |
number |
Width |
h |
number |
Height |
Example
natiny.render.rectangle(40, 40, 120, 80)
Notes
(x, y)is the top-left corner; positivewandhextend right and down.