natiny.window.get_state

Lua
natiny.window.get_state(win) -> state

Returns the current window state observed by the platform.

Parameters

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

Returns

Type Description
number One of the constants below; natiny.window.STATE_NORMAL for an invalid handle

Constants

Constant State
natiny.window.STATE_NORMAL Normal window
natiny.window.STATE_MINIMIZED Minimized window
natiny.window.STATE_MAXIMIZED Maximized window
natiny.window.STATE_FULLSCREEN Fullscreen window

Example

Lua
if natiny.window.get_state(win) ~= natiny.window.STATE_MINIMIZED then
    draw_the_world()
end

Notes

  • In a browser, the function returns only natiny.window.STATE_NORMAL or natiny.window.STATE_FULLSCREEN.
  • On Android, the function returns the last supported state requested through natiny.window.set_state: natiny.window.STATE_NORMAL or natiny.window.STATE_FULLSCREEN.