I am trying to create a simple start screen for a game and I am using LWJGL with nifty-gui.
Here is my existing code :
public class Main {
public Main(){
if (!LwjglInitHelper.initSubSystems("Risk It")) {
System.exit(0);
}
Nifty nifty = new Nifty(
new LwjglRenderDevice(),
new OpenALSoundDevice(),
new LwjglInputSystem(),
new AccurateTimeProvider());
Game game = new Game(nifty);
}
public static void main(final String[] args) throws Exception {
Main main = new Main();
}
}
public class Game {
public Game(Nifty nifty){
nifty.fromXml("util/tutorial.xml", "start");
LwjglInitHelper.renderLoop(nifty, null);
LwjglInitHelper.destroy();
}
}
The LwjglInitHelper class can be found here
And my XML is :
<?xml version="1.0" encoding="UTF-8"?>
<nifty>
<useStyles filename="nifty-default-styles.xml" />
<useControls filename="nifty-default-controls.xml" />
<screen id="start">
<layer id="background" childLayout="center">
<image filename="util/img/menuTexture.png" />
<text text="My Cool Game" font="Venus_Rising.fnt" width="100%" height="100%" />
</layer>
</screen>
</nifty>
The text is not appearing on the screen though :
The .fnt file and .png file are in my classpath, in the src folder.
Any idea what the problem would be?