0
Я пытаюсь создать простой стартовый экран для игры, и я использую LWJGL с nifty-gui.Текст Nifty-GUI не отображается
Вот мой существующий код:
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();
}
}
LwjglInitHelper класс можно найти here
И мой XML является:
<?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>
текст не отображается на экране хотя:
Файл .fnt и .png находятся в моем пути к классу, в папке src.
Любая идея, в чем проблема?