I'm trying to setup touch hit testing on some characters I have in a very basic game but running into issues in which I think may be a bug in cocos2d or simply my error.
Hit Test Code:
- (BOOL)touchInsideCharacter:(UITouch *)pTouch {
CGPoint touchPoint = [self.parent convertTouchToNodeSpaceAR:pTouch];
return CGRectContainsPoint(self.boundingBox, touchPoint);
}
The character has an anchor point of something like 0.5, 0.176. I think what may be happening is the touch is calculated in local coordinates while the bounding box is in parent coordinates space?
Essentially the touch area seems to always be off on the Y axis but is fine on the X.
Any help appreciated.
-Robert