Patch Editor
Utility Patches
Insets Unpack Patch

Insets Unpack Patch

Use the Insets unpack patch to unpack a device's inset values and output them as numbers relative to the edge of the screen.

This patch is useful for discovering a device’s safe area — the rectangle, inset from the edges of a screen, where the user is guaranteed to be able to interact with your effect.

Input

NameDescription

Insets

An object containing insets information

Outputs

NameDescription

Top

A number that represents the top inset.

Left

A number that represents the left inset.

Bottom

A number that represents the bottom inset.

Right

A number that represents the right inset.

Example

In the example below we used the Insets Unpack patch to unpack the Safe Area Insets of a device screen.

First we set the device in the Simulator to iPhone8, then we connected:

  1. The Safe Area Insets output of the Device Producer Patch to the Insets input on the Insets Unpack patch.

  2. The Top, Left, Bottom and Right values to the input of 4 Value patches.

The graph shows that the safe are of the iPhone8 is:

  • 60 pixels from the top edge of the screen.
  • 0 pixels from the right edge of the screen.
  • 0 pixels from the left edge of the screen.
  • 100 pixels from the bottom edge of the screen.