Image Button
выводится нормально, но при нажатии ничего не происходит.
ImageButton.ImageButtonStyle ImageButtonRight = new ImageButton.ImageButtonStyle();
ImageButtonRight.up = skin.getDrawable("button_right");
ImageButtonRight.down = skin.getDrawable("button_right");
ImageButton buttonRight = new ImageButton(ImageButtonRight);
buttonRight.setSize(200, 200);
buttonRight.setPosition(10, 10);
buttonRight.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
return true;
}
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
game.setScreen(new GameOverScreen(game));
dispose();
}
});
stage.addActor(buttonRight);