CreateFullscreenUI and DeviceSourceManager on android device?

Hi, @ryantrem
I need a solution for my app on andoid with babaylonjs react native:

function _createFullscreenUI() {
    var modalGUI = GUI.AdvancedDynamicTexture.CreateFullscreenUI("modalGUI");
    var panel = new GUI.StackPanel();
    panel.width = "220px";
    panel.horizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
    panel.verticalAlignment =GUI.Control.VERTICAL_ALIGNMENT_CENTER;
    modalGUI.addControl(panel);

    var header = new GUI.TextBlock();
    header.text = "Y-rotation: 0 deg";
    header.height = "30px";
    header.color = "white";
    panel.addControl(header); 

    var slider = new GUI.Slider();
    slider.minimum = 0;
    slider.maximum = 2 * Math.PI;
    slider.value = 0;
    slider.height = "20px";
    slider.width = "200px";
    slider.onValueChangedObservable.add(function(value) {
        header.text = "Y-rotation: " + value + " deg";
        console.log("Y-rotation: " + value + " deg");
    });
    panel.addControl(slider);    
  }

Is there onValueChangedObservable on android?
How should I connect this with DeviceSourceManager?
Is there example for this?
Thanks

Hey! I think android has nothing to do with pure Babylon code :slight_smile: so you can start by creating your example in the PG so we can help you more easily.

What do you want to do in the onValueChangedObservable observable?

1 Like

Adding @ryantrem for Babylon React Native ?

We don’t have input hooked up yet and the GUI is still a WIP. You will have lots of trouble getting this to work at the moment. :frowning:

Yep, what @bghgary said :slight_smile:

For now, your best bet is probably to use React Native UI if it makes sense for your scenario. I think this going this route is already covered in your other question here: Scaling mesh with slider does not work - Questions - Babylon.js (babylonjs.com). Please let us know if there are further questions for this thread though!

1 Like