【发布时间】:2013-03-21 20:22:02
【问题描述】:
为什么我来自 libgdx 的 TextButton 对点击没有响应?
我有一个按钮,这个按钮有一个监听器,但它没有响应。 该按钮正在显示,但在单击鼠标时没有响应。
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);
}
【问题讨论】:
-
有人知道为什么吗?
标签: java button libgdx mousepress