I am trying to disable TextButton, which I encoded as follows:
final TextButton newGameButton = new TextButton("New Game", style);
newGameButton.addListener(new InputListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y,
int pointer, int button) {
Tyr.getInstance().setScreen(new GameScreen());
AudioHelper.stopMusic();
return true;
}
});
table.add(newGameButton).spaceBottom(BUTTON_SPACE);
table.row();
However, the setDisabled (true) function does not work. Is there any other way I can accomplish this task?
source
share