我想在cocos2d iPhone中检测box2d机身上的捏,但我不知道从哪里开始。对象很简单b2cirleshapes。我知道ios有uipinchgeasture识别器,但我不知道这是不是这样或如何在box2d对象上实现它。 谢谢你!
答案 0 :(得分: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
}
}