I am currently using libgdx. Below codes are added to a stage.
this.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");
}
public void touchDragged(InputEvent event, float x, float y , int pointer) {
System.out.println("dragged");
zoom(0.01f);
}
public boolean scrolled(InputEvent event,
float x,
float y,
int amount) {
System.out.println("scrolled");
zoom(0.01f);
return true;
}
everything is working just fine (touchUp touchDragged Touchdown) except scrolled. Can someone tell me what is the reason?
-edited for reply comment and answer- On screen class outside stage, I think I already added like screen.set input processor(stage). So touch dragged is working properly and print message 'dragged' and zoom is working. But when I scroll, message 'scrolled' is not printed and zoom function is not called I think. Thank you for comment and answer