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