How to get if image is touched and not the background? LIBGDX

the image is a persons head, i want it to only work when the head is touched not the background

stage.addListener(new ClickListener()
{
@Override
public boolean touchDown(InputEvent event, float x, float y, int a , int b)
{
if(box.equals(stage.hit(x,y,false)))
{

box.setPosition(100, 100);
point.play();
score++;
}
else
{
state = GameState.GAMEOVER;
}
return true;
} });

no one has even an idea?

You want to check if the mouse is within over the head?


if(x >= headX && x <= headX + headWidth && y >= headY && y <= headY + headHeight)
     // The mouse is inside the head
else
     // The mouse is outside the head

This is just simple AABB to point collision detection. If the head will be rotated, then you will have to use a different approach.

I think he is after a more advanced collision detection, one that counts the hound as a round blob within a square(the ‘background’?). No?

If not, then you can just create rectangles over the image, then use the .contains() on it?