在使用UIPinchGestureRecognizer的Cocos2d中,如何获取捏合坐标?

最佳答案

-(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;
}

...假设self是您的场景。

关于objective-c - 带有UIPinchGestureRecognizer的Cocos2d,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8319937/

10-11 20:15