Difference between revisions of "love.window.getSafeArea"

(Created page with "{{newin|11.3|113|type=function}} Gets area inside the window which is known to be unobstructed by a system title bar, the iPhone X notch, etc. Useful for making sure UI el...")
 
m
Line 1: Line 1:
 
{{newin|[[11.3]]|113|type=function}}
 
{{newin|[[11.3]]|113|type=function}}
 
Gets area inside the window which is known to be unobstructed by a system title bar, the iPhone X notch, etc. Useful for making sure UI elements can be seen by the user.
 
Gets area inside the window which is known to be unobstructed by a system title bar, the iPhone X notch, etc. Useful for making sure UI elements can be seen by the user.
{{notice|It's unknown whetever this function returns in DPI-scaled units or in pixels. Please update this information.}}
 
  
 
== Function ==
 
== Function ==
Line 17: Line 16:
  
 
== Notes ==
 
== Notes ==
Currently it only has a proper implementation on iOS and will return the window's full size otherwise.
+
* Currently it only has a proper implementation on iOS and will return the window's full size otherwise.
 +
* Values returned are in DPI-scale units, not in pixels.
  
 
== See Also ==
 
== See Also ==

Revision as of 13:23, 26 December 2018

Available since LÖVE 11.3
This function is not supported in earlier versions.

Gets area inside the window which is known to be unobstructed by a system title bar, the iPhone X notch, etc. Useful for making sure UI elements can be seen by the user.

Function

Synopsis

x, y, w, h = love.window.getSafeArea( )

Arguments

None.

Returns

number x
Starting position of safe area (x-axis).
number y
Starting position of safe area (y-axis).
number w
Width of safe area.
number w
Height of safe area.

Notes

  • Currently it only has a proper implementation on iOS and will return the window's full size otherwise.
  • Values returned are in DPI-scale units, not in pixels.

See Also


Other Languages