natiny.surface.resize
natiny.surface.resize(surf, width, height)
Replaces a surface's attachments with new attachments of the requested size.
Parameters
| Name | Type | Description |
|---|---|---|
surf |
number |
Surface handle from natiny.surface.create |
width |
number |
New surface width in pixels |
height |
number |
New surface height in pixels |
Example
natiny.surface.resize(surf, 1920, 1080)
Notes
- The colour and depth texture handles do not change. Anything already given one of them - a material, a model part - keeps working and reads the resized attachment. Only the pixels are lost; redraw the surface.
- An unchanged size is a no-op. Zero dimensions, an invalid handle or an unavailable graphics device are ignored.
- If allocation fails, the surface is left at the size it already had and stays usable.