GameMaker (2.0 - 2.2.x)
Icon

iOS Safe Area

Liquid Games

You must be logged in to obtain assets

Description

iPhone X screen notch will make your games appear cropped unless you can detect its safe area.

This extension retrieves the safe area from any iOS device so you can keep your graphic resources and buttons inside it.

Just call iOS_get_safe_area() and it will return a json formatted string with all the information you need. You can convert that string to a ds_map by using json_decode(). These are the keys/values you will get:

  • "detected": If the device is running iOS 11.0 or higher, the detection will be possible and this value will be 1, otherwise it will be 0.
  • "top": the height in pixels outside of the safe area at the upper side of the screen.
  • "bottom": the height in pixels outside of the safe area at the bottom side of the screen.
  • "left": the width in pixels outside of the safe area at the left side of the screen.
  • "right": the width in pixels outside of the safe area at the right side of the screen.

The provided project has a working demo as seen in the screenshots.

You will need Game Maker Studio 2 with the iOS export module in order to get it working.

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS2 - Version 1.0.0. Published October 24, 2018

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait