4
爲什麼我的TextButton
,來自libgdx不響應點擊?Libgdx爲什麼我的按鈕沒有響應mouseclicks
我有一個按鈕,這個按鈕有一個監聽器,但它沒有響應。 該按鈕正在顯示,但在鼠標單擊時不響應。
public MyStage extends Stage {
...
next.addListener(new InputListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
{
Gdx.app.log(ApothecaryGame.LOG, "Pressed: Next button.");
return true;
}
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
Gdx.app.log(ApothecaryGame.LOG, "Released: Next button.");
super.touchUp(event, x, y, pointer, button);
nextPage();
}
});
this.addActor(next);
}
有沒有人知道爲什麼? –