In Cocos2d while using the UIPinchGestureRecognizer, how do you get the pinch coordinates?
-(void)handlePinchFrom:(UIPinchGestureRecognizer*)recognizer
{
// How to get the coordinates.
CGPoint touchLocation = [recognizer locationInView:recognizer.view];
touchLocation = [[CCDirector sharedDirector] convertToGL:touchLocation];
touchLocation = [self convertToNodeSpace:touchLocation];
// How to get the scale.
float scale = recognizer.scale;
}
... assuming that self is your scene.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With