سؤال

I am using cocos 2d and I wanted to track multiple independent pan gestures. But I don't know how to do this neither by using onTouchBegin nor UIPanGesture class. If you could help me, I'd be grateful.

I've multiple sprites in the screen. I want the user to be able to drag them independently and concurrently.

هل كانت مفيدة؟

المحلول

In the gesture delegates for both of your recognizers, implement the following protocol method:

-(BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer
{
    return YES;
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top