I am developing an Android game using LibGDX. There are 4 buttons in a menu screen, but the ClickListener
of these buttons is not working.
//
Instead of "click method" now it's "clicked method" (I think!), just in case someone faces the same problem I was facing when found this question:
startGameButton.addListener( new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
game.setScreen( new GameScreen(game) );
};
});
You have to add the button to the stage and call
Gdx.input.setInputProcessor(stage);