natiny.render.texture
natiny.render.texture(tex, x, y, w, h)
Draws a texture at the specified position and size using the current draw color.
Parameters
| Name | Type | Description |
|---|---|---|
tex |
number |
Texture handle from natiny.texture.create |
x |
number |
X position in pixels |
y |
number |
Y position in pixels |
w |
number |
Positive draw width in pixels |
h |
number |
Positive draw height in pixels |
Example
natiny.window.bind(win)
natiny.render.set_color(1.0, 1.0, 1.0, 1.0)
natiny.render.texture(tex, 100.0, 50.0, 64.0, 64.0)
natiny.window.unbind()
Notes
- Draws to the render target most recently bound with
natiny.window.bind()ornatiny.surface.bind(). - Tint color is controlled by
natiny.render.set_color(). Call it before drawing to change the color. wandhare required. Non-positive sizes do not draw anything.