Hi,
I spend the whole day trying to get TWL to work with Slick, but it seems to behave different then documented:
i have 3 gamestates: MainMenuState, NetworkState and inGameState. To join a game you have to go throw all of them in sequence, starting with the MainMenuState and ending with inGameState.
As part of my immigration to TWL, i downloaded the provided .zip and made all of my classes into 'BasicLWTGameState'.
I have the same code in all of these classes, but it only seems to trigger(the output only displays once) in the NetworkState one (there i can see the button).
The code in all of the Classes:
Code:
private Button btn;
@Override
protected RootPane createRootPane() {
RootPane rp = super.createRootPane();
System.out.println("set theme... " + rp.getTheme());
rp.setTheme("myTheme");
btn = new Button("connect");
btn.setTheme("myButton");
btn.addCallback(new Runnable() {
public void run() {
System.out.println("it works?!");
}
});
rp.add(btn);
return rp;
}
@Override
protected void layoutRootPane() {
btn.adjustSize();
btn.setPosition(100, 100);
}
TL;DR: I can see a Button in the second of 3 States but not in the first or third one + the createRootPane does seems to only be called once instead once for every State.
I hope someone can help me.
Thanks in advance!
-ara