Nifty GUI: loading new xml files and a question about the mouse

I’m trying to load a gui layed out in xml. The problem is, I already have an xml file loaded, and I don’t want the gui to disappear. I’m not sure if nifty keeps already loaded files in memory or not, so I’m afraid the gui will disappear when I load the new one (as suggested by the docs for Nifty.fromXml).



Also, how do I stop the mouse cursor from disappearing when I drag (I have flyByCamera.setDragToRotate(true) set, but that only shows the mouse if you click on a gui element)?

You can just call flyCam.setEnabled(false) to make the cursor always visible

well, you could use nifty.fromXmlWithoutStartScreen() to load the new xml file BUT this will remove all previously loaded screens.



Nifty does not support loading additional screens at the moment and keeping the old ones. Sounds like a nice feature to have tho :slight_smile:

The handbook of Nifty 1.3.1 states that there is a method addXml(String filename) to load definitions from multiple files. But the API doesn’t have that method :frowning:

Noticed the topic is a bit older, but the problem is still the same. Is there a way to do it now?

[java]nifty.addXml(String filename);[/java] does exist, I used 10 seconds ago

Then we use a different API: Nifty 1.3-SNAPSHOT API

Is there a nifty version I missed? As far as I know 1.3 (previously named 1.3.1) is the latest official release.

@yajirobee said:
Is there a nifty version I missed?

Just make sure you have updated the SDK to the latest stable version. If you use eclipse then we cannot say, you configured the classpath in that case.

That’s my classpath file:

[xml]<?xml version=“1.0” encoding=“UTF-8”?>

<classpath>

<classpathentry kind=“src” path=“src”/>

<classpathentry kind=“con” path=“org.eclipse.jdt.launching.JRE_CONTAINER”/>

<classpathentry kind=“lib” path=“lib/assets.jar”/>

<classpathentry kind=“lib” path=“lib/eventbus-1.4.jar”/>

<classpathentry kind=“lib” path=“lib/j-ogg-oggd.jar”/>

<classpathentry kind=“lib” path=“lib/j-ogg-vorbisd.jar”/>

<classpathentry kind=“lib” path=“lib/jbullet.jar”/>

<classpathentry kind=“lib” path=“lib/jinput.jar”/>

<classpathentry kind=“lib” path=“lib/jME3-lwjgl-natives.jar”/>

<classpathentry kind=“lib” path=“lib/jme3testdata.jar”/>

<classpathentry kind=“lib” path=“lib/jMonkeyEngine3.jar”/>

<classpathentry kind=“lib” path=“lib/lwjgl.jar”/>

<classpathentry kind=“lib” path=“lib/nifty-1.3-SNAPSHOT.jar”/>

<classpathentry kind=“lib” path=“lib/nifty-default-controls-1.3-SNAPSHOT.jar”/>

<classpathentry kind=“lib” path=“lib/nifty-style-black-1.3-SNAPSHOT.jar”/>

<classpathentry kind=“lib” path=“lib/stack-alloc.jar”/>

<classpathentry kind=“lib” path=“lib/vecmath.jar”/>

<classpathentry kind=“lib” path=“lib/xmlpull-xpp3-1.1.4c.jar”/>

<classpathentry kind=“output” path=“build/classes”/>

</classpath>

[/xml]

And yes, I’m using Eclipse. I thought it was the latest one.

as you have those -SNAPSHOT files, thats definitely a very old version of jme3

Edit: actually ancient, it also has the jMonkeyEngine3.jar still… No follow-up questions from your side needed, its all written in the wiki.

You mean the Wiki that states 1.2. is the latest build?

http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Getting_Started



We know that we use an old jME, but that should be irrelevant for this topic.

Just noticing that the links actually do not lead to 1.2 but to 1.3.1, so I’ll try that.

Thanks for the replies.

No I mean our wiki and how you get the latest version of jme including all libraries in the versions we supply.

Nifty GUI comes included with jME3. Since you use a very old version of jME3, consequently your Nifty GUI version is also very old.