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

Set transparent background color for transparent SceneView #309

Merged

Conversation

grassydragon
Copy link
Contributor

No description provided.

@ThomasGorisse ThomasGorisse merged commit 03409ab into master Feb 9, 2022
@ThomasGorisse ThomasGorisse deleted the feature/transparent-background-color-in-sample branch February 9, 2022 08:35
@eqgis
Copy link

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
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants