Hey all,
As the title says, I’m getting that error when trying to load a menu with nifty. I’ve been googling this for the last hour, and that specific exception doesn’t really seem to exist, which is nice. I’m going to post relevant code:
Method that creates nifty:
[java]
Nifty nifty;
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager, audioRenderer, guiViewPort);
nifty = niftyDisplay.getNifty();
MenuController control = new MenuController();
nifty.registerScreenController(control);
nifty.fromXml("Interface/Nifty/menus.xml", "start");
// attach the nifty display to the gui view port as a processor
guiViewPort.addProcessor(niftyDisplay);
nifty.gotoScreen("start");[/java]
menus.xml:
[java]
<?xml version=“1.0” encoding=“UTF-8”?>
<nifty
xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>
<screen id=“start” controller = “projectlaggo.com.wordpress.cptspike.MenuController”>
<layer id=“background” childLayout=“center”>
<image filename=“Interface/Nifty/splash.png”></image>
</layer>
<layer id=“foreground” backgroundColor="#0000" childLayout=“vertical”>
<panel id=“panel_mid” height=“50%” width=“75%” align=“center” childLayout=“center”
backgroundColor="#0f08">
<control name=“startButton” label=“Start” id=“StartButton” align=“center” valign=“center”>
</control>
<control name=“startButton” label=“Quit” id=“QuitButton” align=“center” valign=“center”>
</control>
</panel>
</layer>
</screen>
<screen id=“hud”>
<layer id=“hudLayer”>
</layer>
</screen>
</nifty>
[/java]
And finally, the entire error message:
[java]
java.lang.RuntimeException: org.xmlpull.v1.XmlPullParserException: Error parsing document. (position: START_TAG seen …net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">… @5:124) caused by: java.lang.NullPointerException
[/java]