+1 vote

Essentially, I am trying to do what this person does in Unity: https://connect.unity.com/p/updating-your-gui-for-the-iphone-x-and-other-notched-devices. Apple user interface guidelines require UI to not be hidden by the notch which is why I'm trying to figure this out.

enter image description here

It might be worth reading the article because it's hard for me to explain how he does this.
But I think the person uses Screen.safeArea (in Unity) to get the safe area of the phone screen, which returns a (x, y, width, height). He converts these dimensions to "normalized anchor coordinates". As a result, it pushes the GUI away from the edges of the screen to be in the safe area.

Just like how Unity has Screen.safeArea , Godot has a basically identical OS method called get_window_safe_area. They both return a (x, y, width, height) of the safe area's bounds.

How can I take these width/height dimensions of the safe area and turn it into the dimensions of the GUI? So that the GUI is pushed into the safe area.

in Engine by (49 points)

Please anybody answer. Especially for Android version. Need this too for a long time.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.