I'm trying to determine if a point is inside a node that's been rotated. I've tried the following code in my scene:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
/* Called when a touch begins */
UITouch *touch = [touches anyObject];
if ([self.cardNode containsPoint:[touch locationInNode:self.cardNode.parent]]) {
NSLog(@"HIT");
}
}
But it seems that the nodes frame is still the same as to when it's not rotated. In other words, points outside of the rotated node (which are in the node when it's not rotated) are considered to be inside of it.
I've also tried using CGRectContainsPoint
which produced the same results.
How can I determine if a point is in a rotated node?