おはようございます! 私はSlick2dでNifty Guiを試しています。 Nifty Guiの入力ポーリング以外はすべて正常に動作します。それはまったく反応しません!ここに私のコードの一部です:Nifty Guiは入力に反応しません
のXml:
<nifty xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
<screen id="GamePlay" controller="GamePlayScreenController">
<layer childLayout="vertical">
<panel id="roomListPanel" width="100%" height="32px"
childLayout="absolute-inside" padding="5px">
<control id="appendButton" name="button" label="Pause">
<interact onClick="test()" />
</control>
</panel>
</layer>
</screen>
</nifty>
のJava:
class GamePlayScreenController implements ScreenController {
public void bind(Nifty nifty, Screen screen) {
System.out.println("Bind");
}
public void onEndScreen() {
System.out.println("End");
}
public void onStartScreen() {
System.out.println("Start");
}
public void test() {
System.out.println("Test");
}
}
...
// In my state class:
this.nifty = new Nifty(new LwjglRenderDevice(), new NullSoundDevice(), new LwjglInputSystem(), new TimeProvider());
this.nifty.loadStyleFile("nifty-default-styles.xml");
this.nifty.loadControlFile("nifty-default-controls.xml");
this.nifty.registerScreenController(new GamePlayScreenController());
this.nifty.fromXml("data/test.xml", "GamePlay");
this.nifty.gotoScreen("GamePlay");
...
this.nifty.update();
...
SlickCallable.enterSafeBlock();
this.nifty.render(false);
SlickCallable.leaveSafeBlock();
それがない理由私は、何のアイデアを持っていません。助けてください!ありがとう!
ありがとうございますが、解決策が機能しませんでした。うん、私はニフティ+スリック2d州を試してみたが、彼らは私を助けなかった。お返事ありがとう! –