, , , ; :
:
class MyClickListener extends ClickListener {
float x, y = 0;
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
this.x = x;
this.y = y;
return super.touchDown(event, x, y, pointer, button);
}
@Override
public void touchDragged(InputEvent event, float x, float y, int pointer) {
this.x = x;
this.y = y;
super.touchDragged(event, x, y, pointer);
}
}
:
class MyActor extends Actor {
private final MyClickListener listener = new MyClickListener();
MyActor() {
addListener(listener);
}
...
}
draw (act) :
if (listener.getPressedButton() >= 0)
System.out.println(listener.x + "; " + listener.y);