Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer
The touchDown and touchMethod is for the Screen(Stage) right? – Rudy_TM Feb 11 '12 at 4:33
Not sure. I get mine from the Game class, which implements ApplicationListener and InputProcessor – ashes999 Mar 12 '12 at 3:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.