How to handle safe area?

Hi everyone,

I’m curious how are you handling the safe area of phones with notch, both on iOS and Android?

As far as I know both OS have utilities to deal with it. Is there any plan to expose it in some way in the engine?

Thanks

There is this extension: https://github.com/defold/extension-safearea

Currently for iOS only but please feel free to contribute an Android solution!

1 Like

Yep, I know about this one. Was looking for something to query safe area dimensions to be able to adapt GUI and gameplay screens.

I guess this would be a good exercise to learn about extensions :stuck_out_tongue:

Ah. I actually think we should modify the existing extension to support this. You should be able to get the safe area and you should be able to adjust the viewport to the safe area. But please go ahead and play around with the extension. It’s not much code so its a good place to start!