natiny.window.get_height

Lua
natiny.window.get_height(win)

Returns the current height of a window in drawing units.

Parameters

Name Type Description
win number Window handle from natiny.window.create

Returns

Type Description
number Window height, 0 if the window does not exist

Example

Lua
local win = natiny.window.create("My Game", 1280, 720)

local h = natiny.window.get_height(win)
print("Height: " .. h)

Notes

  • In natiny.window.SCALE_MODE_PIXELS, the result is the number of window pixels. In SCALE_MODE_STRETCH and SCALE_MODE_HIDPI, it is the height used by 2D drawing and mouse input.