Immersive mode in android covers notification bar

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vbdev

Hello everyone,

I am developing a game in godot version 3.2.3 with immersive mode enabled. When exported to android mobile (Samsung M30) it is working properly as I needed.

Yesterday I downloaded the latest version 3.3, but in this version if immersive mode is enabled the game covers full screen including the camera area. So the top portion of the game gets cutoff. It is fixed If immersive mode is disabled but then the navigation keys become visible.

Is there any setting in the new version so that the navigation bar is covered by the game but not the notification bar at the top? (The same project still looks proper if exported from older version)

Second question, should I use newer version for development purpose (as it may have more features), & when the development is completed, export the project from older version? Will such project always run from older version (if in case any of the new features are used) ?

Thanks

:bust_in_silhouette: Reply From: Calinou

This was originally submitted in a proposal and it seems this feature is now implemented in 3.3.

You can use OS.get_window_safe_area() to return the Rect2 where controls should be rendered. Use this in a script to move controls away from the top so they don’t touch the notch.

Second question, should I use newer version for development purpose (as it may have more features), & when the development is completed, export the project from older version? Will such project always run from older version (if in case any of the new features are used) ?

If you are working under a deadline and don’t need features from a newer version, it’s recommended to stick to the version you’re currently using during the course of the project. Otherwise, you can upgrade to new versions if you’re OK with dealing with occasional regressions.

Thank you for your quick reply. So actually this is a feature in newer version :slight_smile:

I used the function suggested by you to find the usable area rect. OS.get_window_safe_area() returns (0, 0, 1080, 2257) in v3.2.3 whereas it returns (0, 83, 1080, 2257) in v3.3. So moving my score panel to rect.y in script solved my problem, thanks.

I noticed that returned Y position is more than actual. Because, in case of v3.2.3 the panel is just below the camera notch whereas in v3.3 it is much lowered. (i.e. physically it is not on the same location in both cases). Anyway, after getting the usable rectangle, if Y position is not zero I can subtract some pixels to achieve the required results.

vbdev | 2021-04-26 08:12