我想检测 cocos2d iPhone 中 box2d 身体上的夹点,但我不知道从哪里开始。这些对象是简单的 b2circleshapes。我知道 ios 有 uipinchgeasture 识别器,但我不知道这是要走的路还是如何在 box2d 对象上实现它。多谢!
1 回答
            1        
        
		
试试这个 -
UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchGesture:)];
[self.box2d addGestureRecognizer:pinchGesture];
有了这个 -
- (void)pinchGesture:(UIPinchGestureRecognizer *)pinch {   
if (pinch.velocity < 0) {
    //close pinch
}
else {
    //open pinch
}
}
于 2012-04-15T04:01:00.867   回答