Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Set transparent background color for transparent SceneView#309

Merged
ThomasGorisse merged 1 commit intomasterfrom
feature/transparent-background-color-in-sample
Feb 9, 2022
Merged

Set transparent background color for transparent SceneView#309
ThomasGorisse merged 1 commit intomasterfrom
feature/transparent-background-color-in-sample

Conversation

@grassydragon
Copy link
Copy Markdown
Contributor

No description provided.

@ThomasGorisse ThomasGorisse merged commit 03409ab into master Feb 9, 2022
@eqgis
Copy link
Copy Markdown

eqgis commented Apr 9, 2022

In SceneView.java
/**
* Set the background to transparent.
*/
public void setTransparent(boolean transparent) {
setBackgroundColor(android.graphics.Color.TRANSPARENT);//Add this line.Avoid this method being invalid.
setZOrderOnTop(transparent);
getHolder().setFormat(transparent ? PixelFormat.TRANSLUCENT : PixelFormat.OPAQUE);
renderer.getFilamentView().setBlendMode(transparent ? View.BlendMode.TRANSLUCENT : View.BlendMode.OPAQUE);
}

@grassydragon
Copy link
Copy Markdown
Contributor Author

setBackgroundColor(android.graphics.Color.TRANSPARENT);//Add this line.Avoid this method being invalid.

Hi!
This can be great when transparent is true but when it is false it isn't clear what color should we use.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants