In my pause dialog, the exit is working correctly, but the resume isn't, if I press resume 3 times, the third time it's going to exit.
ImageButton btnPlayOn = UIFactory.createButton(txtrPlayOn);
btnPlayOn.setSize(40, 40);
btnPlayOn.setPosition(75, 75, Align.center);
dialogP.addActor(btnPlayOn);
ImageButton btnEndGame = UIFactory.createButton(txtrEndGame);
btnEndGame.setSize(40, 40);
btnEndGame.setPosition(75, 55, Align.center);
dialogP.addActor(btnEndGame);
btnPlayOn.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
System.out.println("resuumeeeeeeee");
}
});
btnEndGame.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
System.out.println("exiiiiiiiiit");
}
});
I think I know why, it's because both buttons have the same x so the listener is getting confused. Anyhow I don't know how to fix it.