私はこのように新しいアクターを定義しました:
class MyActor extends Image
{
Texture texMyActor;
public MyActor()
{
super.setTouchable(Touchable.enabled);
texMyActor = new Texture("data/myActor.png");
addListener(new InputListener()
{
public boolean touchDown(InputEvent event, float x, float y,
int pointer, int button)
{
System.out.println("down");
return true;
}
public void touchUp(InputEvent event, float x, float y,
int pointer, int button)
{
System.out.println("up");
}
});
}
@Override
public void act(float delta)
{
super.act(delta);
}
@Override
public void draw(SpriteBatch batch, float parentAlpha)
{
batch.draw(texMyActor, 200, 200);
}
}
また、アクターをステージに追加し、現在の入力プロセッサーとしてステージを登録しました。次に、stage.act(deltaTime)とstage.draw()を呼び出します。アクターが表示されますが、入力に応答しませんコードの何が問題になっていますか?:?: