Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android mobile screen expanding till front camera region in portrait mode #44946

Closed
abhiagnihotri01 opened this issue Jan 5, 2021 · 3 comments

Comments

@abhiagnihotri01
Copy link

Godot version:
3.2.4 beta

OS/device including version:
Product: Redmi Note 7 Pro
Version: Android 10
CPU: arm64
Backend: GLES3

Issue description:
When i run game with Mode=2D and Aspect=Ignore, the game is getting extended till front camera. Due to this, the game contents at top middle part are getting hidden behind the front camera. I want the game to expand till just below the front camera.

Steps to reproduce:
Run any game with a background in android device having front camera coming in front of mobile screen. In my case i am using the Redmi Note 7 Pro mobile.

Minimal reproduction project:
Mobile_Screen

@mbrlabs
Copy link
Contributor

mbrlabs commented Jan 7, 2021

I could reproduce this on my Galaxy S10 starting with beta2, but it seems it's a feature added in #43140 (#43104 for master). You can get the safe area for your UI with OS.get_window_safe_area() though. cc @Klowner

@Calinou
Copy link
Member

Calinou commented Jan 7, 2021

When i run game with Mode=2D and Aspect=Ignore, the game is getting extended till front camera.

As a friendly reminder, do not use the ignore aspect in production games. This will cause visible distortion on any aspect ratio not matching your base aspect ratio. Now that phones exist in many aspect ratios (16:9, 18:9, 19:9, 19.5:9, 21:9, …), you really need to support multiple aspect ratios properly to give everyone a good experience.

Instead, use the expand stretch aspect and configure your UI anchors correctly.

@abhiagnihotri01
Copy link
Author

Thanks for the reply @mbrlabs. The function OS.get_window_safe_area() solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants