NiftyGUI Java ScreenBuilder

Hello Guys,



I found out that the new NiftyGUI ScreenBuilder class is not implemented into jme3 trunk.

So i was wondering when it will be implemented.

Or do i use the wrong import mybe?



I was trying out the example from the NiftyGUi site:

[java]

Screen mainScreen = new ScreenBuilder(“main”) {{

controller(new ScreenControllerExample());



layer(new LayerBuilder(“layer”) {{

backgroundColor("#003f");

childLayoutCenter();



panel(new PanelBuilder() {{

id(“panel”);

childLayoutCenter();

height(percentage(25));

width(percentage(80));

}});

}});

}}.build(nifty);[/java]



But it does not find the classes.



Thanks in advance

Thorsten

We recently updated to release 1.2, I guess this feature was added in 1.3 snapshot. You could always get the nightly builds from the nifty website and hopefully it should work with jME3.

are the JME guys planning to add it to the libraries?

We’re unlikely to release any Nifty-GUI features that haven’t gone “stable” yet, as in Jens “void” makes a new official release. By the time Nifty-GUI 1.3 is released, you can remind us :wink:

Not sure if this has already been noted, but you can use the ScreenBuilder in jme3.

[java]

NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,

inputManager,

audioRenderer,

guiViewPort);

Nifty nifty = niftyDisplay.getNifty();

nifty.loadStyleFile("nifty-default-styles.xml");

nifty.loadControlFile("nifty-default-controls.xml");



Screen mainScreen = new ScreenBuilder("main") {{

controller(new TestScreen());

layer(new LayerBuilder("layer") {{

backgroundColor("#003f");

childLayoutCenter();

panel(new PanelBuilder() {{

id("panel");

childLayoutCenter();

height(percentage(25));

width(percentage(80));

}});

}});

}}.build(nifty);

nifty.addScreen("main", mainScreen);

nifty.gotoScreen("main");

guiViewPort.addProcessor(niftyDisplay);

[/java]

Not sure if there is a more robust way in the pipeline, but this works…



Edit: I was a little off, but I corrected the code above.