I am using "Gdx.input.isTouched()" in the render method of my Screen method, to know where is touched, but when the touch is dragged in the screen, it also activates the events i want only when an actor is touched.

Is there any listener to know when an Actor is touched, but the event is not the dragged one, im doing it with sprites.


2 Answers 2


There's a TouchUp and TouchDown method if I'm not mistaken. You need to keep track of state.

I handle this in my projects by creating a custom MyAwesomeSprite class; on TouchDown, I just set _isTouched=true, and on TouchUp, I set _isTouched = false. This allows me to detect dragging (touch-down triggered when _isTouched is already true), so I can easily distinguish between these two cases.

  • \$\begingroup\$ The touchDown and touchMethod is for the Screen(Stage) right? \$\endgroup\$
    – Rudy_TM
    Commented Feb 11, 2012 at 4:33
  • \$\begingroup\$ Not sure. I get mine from the Game class, which implements ApplicationListener and InputProcessor \$\endgroup\$
    – ashes999
    Commented Mar 12, 2012 at 3:30

Add a Listener to the actor like so. Note you need an InputMultiplexer so your Stage and Screen can both handle touches. Add the Stage first so it gets clicks first, then in the Listener call event.handle() and return true otherwise the touch will bubble through and be picked up by your Screen too.

actor.addListener(new ClickListener(){
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
                event.handle();//the Stage will stop trying to handle this event
                return true; //the inputmultiplexer will stop trying to handle this touch

Some actors will require


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .