I have an actor that keeps an sprite to render its view. The way I determine a hit for this actions is getting thesprite bounding box and calling its contains point method agains the x,y hit function params. This seems to be not working. Have been looking for a way to do this based on examples, etc... but haven't been able to find anything. Could anybody suggest a way to do this?

Are you certain that the coordinates that you are getting are what you think they are? In other words, are x, y and the sprite's bounding rectangle all sane values, or is there a big discrepancy between what you see on screen and what you are actually getting?
–
Rod HydeJan 23 '13 at 20:48

1 Answer
1

According to the scene2d hit detection wiki the hit method is invoked when the stage determines the Actor's bounding box is "hit". You only need to override hit if you want to further refine the hit (e.g., your sprite is round, and you want to make sure you avoid a "hit" in the bounding box if its outside the radius, etc).

If you want to do something after your Actor is touched, you need to override the appropriate InputListener methods. See InputListener section of that same wiki for more details.