Pergunta

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.

Foi útil?

Solução

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

-(BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer
{
    return YES;
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top