I'm making a game like angry birds with LibGDX and box2d in which I want to drag a ball (instead of the bird) back before releasing it.
I deploy with testPoint function: when I touch down the screen, I check if the point is within the body of the ball or not but testPoint function never works exactly. Here's what I'm trying thanks so much:
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
for(Fixture fixture:bird.getBody().getFixtureList()) {
if(fixture.testPoint(screenX/100, (mapHeight-screenY)/100)) { //100 is scaled parameter
draggedBird = true;
return true;
}
}
return false;
}