I’m sad to say that, but this tonegod gui is really making me mad.
I implemented a simple UI with a button … if the button is pressed, the method startGame() is called.
m_buttonStart = new ButtonAdapter(m_screen) {
@Override
public void onMouseLeftReleased(MouseButtonEvent evt) {
startGame();
}
};
That seemed to work, if I click the button … but: after the game is startet it’s kind of screwed up. When I press the space bar in the game, it randomly activates some custom app states that sould not be activated. Every time.
I looked for hours, and it really seems to be the CLICK at the button which causes this strange behaviour. I added a KeyTrigger to the GUI, so that it reacts on the RETURN key. When RETURN is pressed, it does nothing different from the above, that is:
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (name.equals(MAPPING_START)) {
startGame();
}
}
An now guess: if I do not click the button but press RETURN, the game reacts normal. If I press the button, the space bar seems to be a TRIGGER for something I did not code …
Any ideas?