2
我曾嘗試在Actor上使用InputListener
,但看起來touchUp並未被調用。其他任何方法都適用於我。Scene2d:InputListener不會調用touchUp
stage = new Stage(new ScreenViewport());
Widget actor = new Widget();
actor.setFillParent(true);
actor.addListener(new InputListener() {
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
Gdx.app.log("", "");
}
});
stage.addActor(actor);
Gdx.input.setInputProcessor(stage);