iPhone X - How to draw in the corners?

Hi, I have just updated my project to ios11 and “iphonex” and I would like to share some thoughts.

Safe area was introcuded with ios11 and I am pretty sure it will be used in the future phones with ios. This is why we shouldn’t stick to “if iphoneX” check. I think there should be just a method like “getSafeAreaRect” (or getAreaForUI) and all the UI (user game touch zone :P) should be positioned in that area. All background elements should be positioned with origin and visibleSize.

In case of other platforms safe area insets may return just 0 (assuming safe area is inside visible size).

I am using cocos2dx v12 and it seems to work.

Yes, you’re right, since I’m not an iOS developer, I just wrote the first thing that came to mind. :slight_smile:

p.s.
The engine already supports this.

Ah… I didn’t notice that final solution was just pushed :wink: Thanks @Priority10 for the info. I will merge it. At least I was thinking right :wink: