natiny.window.create
Lua
natiny.window.create(title, width, height)
Creates a new application window.
Parameters
| Name |
Type |
Description |
title |
string |
Window title |
width |
number |
Requested window width; its on-screen size follows OS display scaling |
height |
number |
Requested window height; its on-screen size follows OS display scaling |
Returns
| Type |
Description |
number |
Window handle |
Example
Lua
local win = natiny.window.create("My Game", 1280, 720)
Notes
- All three arguments are required.
- A scaled display can give the window more pixels than the requested size.
Use
natiny.window.get_scale to read the scaling factor.
- New windows use
natiny.window.SCALE_MODE_PIXELS, which draws pixel for pixel
and does not apply the display scaling factor.
- Desktop backends support multiple windows simultaneously.
- Web builds support one window only; it maps to the page's
<canvas> element.