How do I actually use nifty?

The documentation provided is really, really, pathetic. I can’t get nifty to work at all.

What is provided on this site is very fragmented and info on the nifty site even worse.

What should be in my imports?

Where in my program is it best to put code to enable nifty?

Import com.jme3.niftygui.NiftyJmeDisplay and put this into your simpleInitApp:


NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(

assetManager, inputManager, audioRenderer, guiViewPort);

nifty = niftyDisplay.getNifty();

nifty.fromXml(“Interface/helloworld.xml”, “start”);

// attach the nifty display to the gui view port as a processor


// disable the fly cam



Then create a new nifty file named “helloworld.xml” in the Interface folder with the following content:



<screen id=“start” controller=“”>




All taken from the “pathetic” wiki page here. Its good you are finally here to improve the documentation for nifty :stuck_out_tongue:

One basic rule of thumb when you ask for help is to not upset the ones that could help.

Nifty GUI is a one man work, he’s pretty busy and he’s working hard to on the next version of the library.

So please…be kind and watch your words.

There is a wiki page on the Nifty site here

You can find a tutorial demo here nifty-tutorial

And you can download sources an javadoc here

Besides you can have a look at the TestNiftyGui in the test repository or by creating a test project in JMP. You’ll get an idea on how to use it in JME3.

Then …when you’ll have warped your head around it, and that you still have specific questions, there are plenty of guys on this forum that will be glad to help…if you ask kindly.

sorry, I guess I can be somewhat harsh sounding in text. But the documentation is not the greatest, especially to a novice. But this is all a work in progress and I figure it’s tough to write documentation on something that’s constantly changing.

Anyhow I figured out my problem. I was using the example code normen posted, I just didn’t include a path to my font in the xml. yeah, a noob mistake.

Thing is, it didn’t crash the game, it just didn’t display the gui. But then I moved the example snippet into a method of it’s own and the game crashed, revealing that it couldn’t find the font.

I’ll try to be more kind in the future.

BTW: It doesn’t say anything about the import on the page on this site. Maybe someone should add that.