Skip to content

Android GodotFragment can't have a transparent background #106703

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

Open
lonevox opened this issue May 22, 2025 · 2 comments · May be fixed by #106709
Open

Android GodotFragment can't have a transparent background #106703

lonevox opened this issue May 22, 2025 · 2 comments · May be fixed by #106709

Comments

@lonevox
Copy link

lonevox commented May 22, 2025

Tested versions

  • Reproducible in: 4.5-dev4, 4.2.2-stable

System information

Godot v4.2.2.stable.mono - Linux Mint 21.3 (Virginia) - X11 - GLES3 (Compatibility) - AMD Radeon RX 6800 (navi21, LLVM 15.0.7, DRM 3.57, 6.8.0-57-generic) () - AMD Ryzen 5 7600 6-Core Processor (12 Threads)

Issue description

A GodotFragment in an Android app can't be given a transparent background with android:background="@android:color/transparent" as well as having the Godot project allow per-pixel transparency with the following project settings enabled:

  • display/window/per_pixel_transparency
  • display/window/size/transparent
  • rendering/viewport/transparent_background

Running the Godot project from the editor, I correctly get a transparent background on Linux:

Image

However, on Android the background shows as black (I've added an image behind the GodotFragment container so I should be able to see it if Godot's background is transparent):

Image

Steps to reproduce

  1. Clone my fork of the GLTF Viewer.
  2. In Android Studio, open the project and sync Gradle.
  3. Run the apps.gltf_viewer run configuration.
  4. Observe that the image of the Godot icon isn't visible behind the GodotFragment, and instead the area that should be transparent is black.

Minimal reproduction project (MRP)

I've modified the GLTF Viewer referenced in the docs with these changes. My fork can be found here.

@llama-nl
Copy link

I think this is expected. Do you have any examples application that has functionality like this? And if you want to see your mobile bg you can take device wallpaper using AndroidRuntime and put this in background.

@m4gr3d m4gr3d self-assigned this May 22, 2025
@m4gr3d m4gr3d added the bug label May 22, 2025
@m4gr3d
Copy link
Contributor

m4gr3d commented May 22, 2025

@llama-nl It's a bug as we don't respect the project's transparency flags when we configure the SurfaceView used for rendering and the theme used for the generated app.

m4gr3d added a commit to m4gr3d/godot that referenced this issue May 22, 2025
m4gr3d added a commit to m4gr3d/godot that referenced this issue May 22, 2025
@m4gr3d m4gr3d linked a pull request May 22, 2025 that will close this issue
@syntaxerror247 syntaxerror247 added this to the 4.5 milestone May 22, 2025
@github-project-automation github-project-automation bot moved this to For team assessment in Platforms Issue Triage May 22, 2025
@syntaxerror247 syntaxerror247 moved this from For team assessment to In progress / Assigned in Platforms Issue Triage May 22, 2025
@syntaxerror247 syntaxerror247 moved this from In progress / Assigned to Fix pending review in Platforms Issue Triage May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Fix pending review
Development

Successfully merging a pull request may close this issue.

4 participants