Detect if user is on an iPhone X

S

superduperbros

Guest
Hello all,

I am building my game for mobile and recently tested it on the iPhone X. My game works fine on it, except for certain GUI elements because the odd nature of the device display. The iPhone X has a weird screen with deeply-rounded corners that will cut off anything located in them (i.e. a pause button in the upper left). There is also a "home indicator" swipe icon that is present that interferes with any GUI located too close to the bottom middle.

I'd like to fix this by customizing the GUI if the user is using an iPhone X, but the question is detecting whether or not they are using one. The manual mentions the following under os_device but nothing seemingly specific to that device; is there any other method?

Code:
Constant .............. Description
device_ios_ipad .... iPad
device_ios_ipad_retina .... Newer iPad with Retina display size of 2048 x 1536
device_ios_iphone6 .... iPhone6 with display size 1334 x 750
device_ios_iphone6plus  ..... Larger iPhone 6 with display 1920 x 1080
device_ios_iphone5 .....  iPhone5 with display size 640 x 1136)
device_ios_iphone  .... Older iPhone/iPod Touch (480 x 320 screen) or Android phone
device_ios_iphone_retina  ..... Newer iPhone/iPod Touch with Retina display of 960 x 640
device_emulator  ..... The device is actually an emulator (Windows Phone or Android)
device_tablet   .....    Android tablet
device_ios_unknown   ....... Unknown or not iOS
 
B

Bayesian

Guest
This is not possible currently in either 1.4 or 2.0 but should be added soon. I still recommend submitting a support ticket.
 

rIKmAN

Member
Until it gets added like Bayesian mentioned, you can detect the resolution of the device and if it's the same as the iPhone X then assume that's what they are using and place UI elements accordingly.

That's assuming no other iOS device has the same resolution as the iPhone X - if so then add a toggle in the options to allow the user to switch the UI placement between normal mode and iPhone X mode.
 

RangerX

Member
Until it gets added like Bayesian mentioned, you can detect the resolution of the device and if it's the same as the iPhone X then assume that's what they are using and place UI elements accordingly.

That's assuming no other iOS device has the same resolution as the iPhone X - if so then add a toggle in the options to allow the user to switch the UI placement between normal mode and iPhone X mode.
You check with more the OS constant and the resolution and you should be good to go¸
 
Top