I’ve seen some posts about the new branch proposal and so like this one WebXR change Default Enter Exit Icons but unfortunately no practical usage case, I’ve tried to make a small change as a sample, that should only move the button to the right but I had no luck, everything seems to be ok… but it just doesn’t work
The WebXR button is a simple HTML element which can be styled using CSS, or completely replaced but a custom button of your choice.
A custom button is just an HTML element on your screen. Any Element you wish to be the clickable element that will get people in XR. To use it you create a WebXREnterExitUIButton (WebXREnterExitUIButton | Babylon.js Documentation) and pass it in the customButtons array of the uiOptions of your experience helper (WebXREnterExitUIOptions | Babylon.js Documentation).
This way you are in full control of the button.
If you want to style the existing item, it’s a button element with the class babylonVRicon. It has a default background image and default colors, and you can change them as you see fit.
Hey, sorry for rescuing this, but I’m not able to make it work
Here I expect to see the button in top right, but because the system put this button in a custom style this is not happen. Any insight is welcome!
ping @RaananW
As it is added to the xr button overlay, which is absolute-positioned, you will need to overwrite the position definition of the container in order to do what you are trying to do:
The issue with this ‘overlay button’ is not only that it add a custom position, but it get the button out from its original list, and I have to manually place it back from javascript, or with ‘!important’ in css. I can live with that, but it’ll be nice a better solution.
ps: I didn’t find in documentation something about, only this topic. I think this will be usefull too
Cheers!
yeah, the more I look at it the more I think that we should not change the added custom button. i’ll follow up on this. for now you will need to manipulate the button using css like you are doing it right now.
by the way…
a main problem to customize a native vr button in some browsers by your own css is a dynamical button behavior of engine
easiest solution is…
just delete all line that contain “_btnVR.style” in sources like this