NiftyGUI & SkyBox --- what did i miss?

Hello,

i am playing around with JMonkey and it works out nicly for me so far.
But now, i wanted to put a NiftyGUI on my scene, but it will not show up.

I drilled the problem down to the simple fact: the NiftyGUI will be rendered ‘behind’ all other objects in a scene.

Its simple to reproduce with

public void simpleInitApp() {
    Box b = new Box(1, 1, 1);
    Geometry geom = new Geometry("Box", b);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", ColorRGBA.Blue);
    geom.setMaterial(mat);
    rootNode.attachChild(geom);

    NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
    niftyDisplay.getNifty().fromXml("Interface/Nifty/MainScreen.xml", "start");
    viewPort.addProcessor(niftyDisplay);
}

with that simple button (Nifty/MainScreen.xml)

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<nifty>
  <useStyles filename="nifty-default-styles.xml"/>
  <useControls filename="nifty-default-controls.xml"/>
  <screen id="start" controller="de.astrotegy.JMEClient2.MainScreen">
    <layer backgroundColor="#0000" childLayout="center" id="layer1">
        <panel backgroundColor="#0000" childLayout="vertical" id="layer11" width="50%" height="75%">
          <control childLayout="center" id="button1" label="Local Game" name="button" width="100%" height="33%"/>
        </panel>
    </layer>
  </screen>
</nifty>

What did i miss? Can i switch the rendering order between the NiftyGUI and the rest of the scene?

I think you want to add the niftyDisplay to the guiViewport instead.

guiViewPort.addProcessor(niftyDisplay);

Ok, thx, that works now as intended :slight_smile: I like answers as simple as this … :+1: