hi
I used a UIRotationGestureRecognizer in cocos2d, which works fine.
However after the recognizer has detected the first rotation gesture, the standard cocos2d touch event handler methods (ccTouchBegan, ...) don't get called anymore.
Anyone knows how this problem can be solved?
UIGestureRecognizer in cocos2d
(5 posts) (4 voices)-
Posted 1 year ago #
-
this is the code I used:
// gesture regognition for rotation gesture
UIRotationGestureRecognizer *rotationGestureRecognizer
= [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(handleRotationGesture:)];
[[[CCDirector sharedDirector] openGLView] addGestureRecognizer:rotationGestureRecognizer];Posted 1 year ago # -
I don't know how the Gesture Recognizer works, but if you find the solution, please, post it here.
But I guess that you have to set the touch delegate again:
eg:
[[[CCDirector sharedDirector] openGLView] setTouchDelegate:[CCTouchDispatcher sharedDispatcher] ];Posted 1 year ago # -
[[[CCDirector sharedDirector] openGLView].superview addGestureRecognizer:gestureRecognizer];
SUPERVIEW! :)
Posted 9 months ago # -
Thank you so much for that little snippet of code. 4 days of crazy research and that was all I needed. Have a great one.
Posted 7 months ago #
Reply
You must log in to post.