natiny.window.get_orientation
Lua
natiny.window.get_orientation(win) -> orientation
Returns the current window orientation derived from its dimensions.
Parameters
Returns
| Type |
Description |
number |
natiny.window.ORIENTATION_LANDSCAPE when width is greater than height, natiny.window.ORIENTATION_PORTRAIT otherwise, or 0 for an invalid handle |
Example
Lua
if natiny.window.get_orientation(win) == natiny.window.ORIENTATION_LANDSCAPE then
draw_toolbar_down_the_side()
else
draw_toolbar_across_the_bottom()
end
Notes
- The result is based on the current window width and height on every platform.
- Use
natiny.window.set_orientation to set the allowed
Android orientations. This function does not return that mask.