Difference between revisions of "Application:getDeviceSafeArea"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Some screens have non rectangular shapes, in which case it is useful to know the bounds of the safe area, that is area that is guaranteed to be visible and user accessible. This functions returns the minimum and maximum coordinates to use, either in physical coordinates or in logical coordinates.
 
Some screens have non rectangular shapes, in which case it is useful to know the bounds of the safe area, that is area that is guaranteed to be visible and user accessible. This functions returns the minimum and maximum coordinates to use, either in physical coordinates or in logical coordinates.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(number), (number), (number), (number) = application:getDeviceSafeArea(logical)
 
(number), (number), (number), (number) = application:getDeviceSafeArea(logical)
 
</source>
 
</source>

Revision as of 16:31, 12 July 2023

Available since: Gideros 2017.11.3
Class: Application

Description

Some screens have non rectangular shapes, in which case it is useful to know the bounds of the safe area, that is area that is guaranteed to be visible and user accessible. This functions returns the minimum and maximum coordinates to use, either in physical coordinates or in logical coordinates. <syntaxhighlight lang="lua"> (number), (number), (number), (number) = application:getDeviceSafeArea(logical) </source>

Parameters

logical: (boolean) returns the margin in logical scale if set to true optional

Return values

Returns (number) minimum x
Returns (number) minimum y
Returns (number) maximum x
Returns (number) maximum y