Problem with nifty gui in jme3

Hello everyone,



recently I've come accross a problem with a gui part of jme3.

I was trying to create a gui screen using this peace of code:



   NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
   Nifty nifty = niftyDisplay.getNifty();
   nifty.fromXml("gui/gui.xml", "start");
   // attach the nifty display to the gui view port as a processor
   guiViewPort.addProcessor(niftyDisplay);
   // and so on ...



The problem occurs when I try to create niftyDisplay object  :|
I get the following error:


java.lang.NoSuchMethodError: de.lessvoid.nifty.Nifty.<init>(Lde/lessvoid/nifty/spi/render/RenderDevice;Lde/lessvoid/nifty/spi/sound/SoundDevice;Lde/lessvoid/nifty/spi/input/InputSystem;Lde/lessvoid/nifty/tools/TimeProvider;)V
at com.jme3.niftygui.NiftyJmeDisplay.<init>(NiftyJmeDisplay.java:42)
at pl.com.talisman.maingame.MainGame.simpleInitApp(MainGame.java:123)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:141)
at pl.com.talisman.maingame.MainGame.initialize(MainGame.java:73)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:147)
at java.lang.Thread.run(Unknown Source)

I checked the nifty api and I found the following constructor for Nifty object:
Nifty(RenderDevice rd, SoundSystem ss, InputSystem is, TimeProvider)

while obviously jme is trying to invoke:

Nifty(RenderDevice rd, SoundDevice sd, InputSystem is, TimeProvider)

Which version of nifty is being used right now ?
I was convinced that currently jme3 uses nifty 1.1  :?

If the version is correct can anyone point my error or show me walkaround ? I suppose there are people who use nifty gui in their applications.

Best regards,
Kaelthas

The current version that work with nifty is 1.2. It should be in the night build in lib folder.



Could I see your gui.xml. Usually how to write your xml format for nifty might the give errors.

You should use the jar that is located in the jme3/lib directory. Newer versions of nifty are not compatible with jME3 (yet)

Thanks a lot  guys :smiley:

Moving to nifty 1.2 from jme3 library did work.



My gui.xml file was a copy of helloworld.xml from nifty examples and it wasn't a actually problem.

After changing the library it worked fine  :slight_smile: