godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Add a way to toggle Android status and navigation bars at runtime #8826

Open sosasees opened 9 months ago

sosasees commented 9 months ago

Describe the project you are working on

a game with

Describe the problem or limitation you are having in your project

i want the status bar and navigation bar to hide during gameplay so they don't distract me

but i want to see the system bars during the menus so i can quickly check battery status and switch apps

— user story

the first part is done because the system bars are hidden by default. but i can't do the second part because i found no way to toggle system bars in GDScript

Describe the feature / enhancement and how it helps to overcome the problem or limitation

adding GDScript methods to

would make it possible to solve the user story.

making separate methods to

would be even better because then games could also

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

the GDScript methods would be:

to improve readability of the system bars, we could also set their background color (but that's out-of-scope for this proposal, and as a workaround we could always place ColorRects behind the system bars):

If this enhancement will not be used often, can it be worked around with a few lines of script?

i believe not: i asked 1 time each across 2 Godot forums and no-one could answer (no longer official forum, official forum)

Is there a reason why this should be core and not an add-on in the asset library?

this will benefit all paid games (and many free games) because they all have pre-game menus and a pause menu

syntaxerror247 commented 4 days ago

@sosasees You can try my Android Plugin System Bar Color Changer, It has the functionality to change system bars color and enable translucent system bars.

Currently you cannot toggle them seperately but you can use DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN) to toggle immersive mode.