Some layers still showing in VR Mode

  • Hi,

    When in VR mode there are still some layers appearing. I was under the impression that no layers would show when in VR mode, which is what I require.

    For example, a background layer still shows. The layer is set to automatically appear onstart for each scene. Any layers with the textfield plugin under this layer don't show in VR.

    Code
    <layer name="scenetextlayer" zorder="6" type="container" devices="mobile" altonloaded="" keep="true" align="center" x="0" y="0" width="90%" height="60%" visible="true" alpha="0" bgcolor="0x08103d" bgalpha="0.7" enabled="true">
    .........</layer>


    Any ideas why this is the case? Is is because the layer type is a container? I've set visibility as false or true in the onentervr/onexitvr events, which works okay to hide/show the layer.
    But when switching to another scene while in VR mode the layer shows up again.

    Just wondering if there's any way to make sure ALL layers are hidden when in VR mode.

    Thanks for any help

  • Hi,

    the hiding of the layers is a 'xml feature', not a plugin one.

    See the webvr.xml for details - there in the 'webvr_onentervr' action all layers without vr="true" will be hidden.

    But when dynamically adding new layers at runtime they will appear of course (just as note - not in real WebVR in Chromium, there only WebGL content will be visible).

    You could check for 'webvr.isenabled' before adding new layers or to set their visibility accordingly or even implement some custom solution by modifying the webvr.xml or by using the WebVR plugin directly without webvr.xml.

    Best regards,
    Klaus

  • Yikes, just when I think I'm done... I've got this same issue: my map is showing up in webvr.

    I don't understand the instructions:

    there in the 'webvr_onentervr' action all layers without vr="true" will be hidden.



    Since my map layer is loaded from the tour.xml, how in the world can I hide it when entering webvr?

    Tnx

  • Sorry Klaus, but I'm at the limits of my understanding about how this works. *sad*

    Where exactly am I placing the if="!webvr.isenabled" ?


    I've tried locating in the map layer within tour.xml:

    <layer name="map" url="graphics/inmap.png" if="!webvr.isenabled"


    But that has no effect - the map still shows up in webVR.

    Is there another location that it needs to go? Do I have to edit the webvr.xml?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!