0
我需要在具有兩個或更多精靈的cocos2d項目中實現一個簡單的捏手勢。你會如此友善地告訴我,我該如何處理俯仰手勢?在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;
}
}
}