display.getReservedRegions()

Type Function
Library display.*
Return value Array
Revision Release 2026.3728
Keywords reserved region, camera cutout, fold, hinge, safe area
See also display.getSafeAreaInsets()
fold

Overview

Returns an array of the screen regions that the system reserves, in content coordinates. A region is one of two kinds:

display.getSafeAreaInsets() only gives a distance from each edge. This function gives the exact rectangle of each region, so you can draw around a camera cutout or lay content out on either side of a fold.

Each element of the array is a table with these properties:

The array is empty when there are no reserved regions.

Note

Reserved regions are currently reported on iOS and iPadOS versions that provide them. Other platforms, including Android and the Simulator, return an empty array. On Android, use the bounds property of the fold event to find the hinge.

Syntax

display.getReservedRegions( [kind] )
kind (optional)

String. Pass "occlusion" or "division" to return only regions of that kind. If omitted, regions of both kinds are returned.

Example

-- Outline every camera cutout and fold on the screen
for _, region in ipairs( display.getReservedRegions() ) do
    local outline = display.newRect( region.x + region.width*0.5, region.y + region.height*0.5, region.width, region.height )
    outline:setFillColor( 0, 0, 0, 0 )
    outline.strokeWidth = 2
    print( region.kind, region.isActive )
end

-- Only look at the fold
local folds = display.getReservedRegions( "division" )
if ( #folds > 0 and folds[1].isActive ) then
    print( "Fold is at y = " .. folds[1].y )
end