Nifty tutorial – load fail

Hello,

im trying out the Nifty-Gui-Tutorial on this page https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:nifty_gui_xml_layout using the Jmonkey SDK.

Everything works fine, the “text”-tag does display in “Design”-view, but when i try to add the “image”-tags shown in the tutorial the Design view does not work anymore. (I guess the problem is the -filename cant be found) Therefore i added the png-files to the same folder as the “screen.xml”-file, but still the png-files are not found by the design view. Where to add the files which are accessed by the “image”-tag ? i have searched nifty’s bible already but couldn’t find anything.

The design view is actually buggy anyway. Are you on linux? Which version of the JDK are you on?

1 Like

I’m on windows 7. Also testniftygui.java doesn’t work, outputting following error:

[java]

com.jme3.asset.AssetNotFoundException: Interface/helloJME.xml

at com.jme3.niftygui.NiftyJmeDisplay$ResourceLocationJme.getResourceAsStream(NiftyJmeDisplay.java:77)

at de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader.getResourceAsStream(NiftyResourceLoader.java:65)

at de.lessvoid.nifty.Nifty.getResourceAsStream(Nifty.java:1581)

at de.lessvoid.nifty.Nifty.loadFromFile(Nifty.java:527)

at de.lessvoid.nifty.Nifty.fromXml(Nifty.java:438)

at TestNiftyGui.simpleInitApp(TestNiftyGui.java:34)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)

at java.lang.Thread.run(Unknown Source)

[/java]

the filename and its location is correct as specified here in the code:

[java]

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

[/java]



EDIT:

If it is of somebodies interest:

I downloaded “NiftyGuiDemo.zip” , imported it in jme3-SDK, started it, worked.

Looked at XML Design view. gave errors. So you are right with the assumption that it is kind of buggy.

Thanks for the tip.