我需要在我的 cocos2d 项目中使用两个或更多精灵实现一个简单的捏合手势。你能告诉我,我该如何处理俯仰手势?
我需要这样的东西:
-(void)handlePinchGesture:(UIPinchGestureRecognizer *)recognizer
{
if (recognizer.state != UIGestureRecognizerStateCancelled)
{
if (recognizer.numberOfTouches == 3)
{
CGPoint firstPoint = [recognizer locationOfTouch:0 inView:recognizer.view];
CGPoint secondPoint = [recognizer locationOfTouch:1 inView:recognizer.view];
CGPoint thirdPoint = [recognizer locationOfTouch:2 inView:recognizer.view];
CGPoint fourthPoint = [recognizer locationOfTouch:3 inView:recognizer.view];
ball1.position=firstPoint;
ball2.position=secondPoint;
ball3.position=thirdPoint;
ball4.position=fourthPoint;
}
}
}