-
Notifications
You must be signed in to change notification settings - Fork 63
Feat/transparent background #314
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
Feat/transparent background #314
Conversation
Thanks for this contribution! There are two main questions for me:
|
Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineView.java
Outdated
Show resolved
Hide resolved
Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineView.java
Outdated
Show resolved
Hide resolved
Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineView.java
Outdated
Show resolved
Hide resolved
Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineView.java
Outdated
Show resolved
Hide resolved
Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineView.java
Outdated
Show resolved
Hide resolved
.../@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineViewManager.java
Outdated
Show resolved
Hide resolved
@chrisfromwork, @rgerd - do you know what needs to happen to at least stub this out on Windows (e.g. just making sure this change doesn't break on Windows even if you don't specify the |
Thank you for the review! 🙌 Well basically I'm not a native developer so sorry for the flaws I might have made here 🙃 I'll try to do some changes based on your suggestions, but I don't really know when. For my project I just patched the package with the transparent solutions, so there is no chance for it being not transparent. This was the case I needed. I'm not quite understand what that XR view is, and for my purpose I haven't needed it. I'll need to take a closer look at that. |
@daenash I think your code is really close, mainly just need to sort out how the transparency flag is passed to the Android The XR view is the augmented reality view when you use Babylon.js to create and start a WebXR session (https://doc.babylonjs.com/divingDeeper/webXR/webXRSessionManagers). So the |
With more code inspection I realized maybe it would be good the separate the two engine views to two separate components One for transparent background one opaque like this <EngineView />
<EngineViewTransparent /> And in the Android part we would implement two different classes which are extending a JAVA abstract class which contains the Babylon updating functionalities. So this way these classes would only need to implement the For iOS as only a flag would change on the View some other approach would be nice. I'll think about it. I'll try to create a structure for what I mean. |
That's an interesting idea. I think I'd be more inclined to keep it as one control though to keep the API simple. If we add more options like this, we could end up with an explosion of control variants, which wouldn't scale. |
Hi @daenash , any update on this PR? |
@CedricGuillemet Hi! No, unfortunately I had no time to follow up with this. 😿 Feel free to continue working on it if you feel so. |
I changed the Android impl:
|
I don't think we should switch to |
Describe the change
Issue #152
The
EngineView
is extended with anisTransparent
boolean flag which is not required to set, on default it's false.If it's set to
true
this happens:TextureView
and the rootFrameLayout
is extended to implement aTextureView.SurfaceTextureListener
. The listener itself is using a similar runnable implementation as the SurfaceView. Note: There is no XR related implementation.MKTView
is extended with an isTransparent@property
and it sets whether the opaque flag is true or false.Screenshots
Nope, sorry 🦄
Documentation
Updated
Testing
I need help testing on Windows
For the other platforms I tested it and it worked, so YES