I finally managed to implement CCLayer scrolling using the UIScrollView derived class, following the instructions mentioned in this question:
, UIScrollViews ( UIViews ) Cocos2D.
, , , : , UIScrollView CCLayer . , , UIScrollView, CCLayer , , , CCLayer (/ CCMenus) .
, Cocos2D , OpenGLView, CCNode CCMenu. 1.0 rc , OpenGLView (, UIScrollView), Cocos2D ( OpenGLView), UIScrollView -touchesBegan: method
[[[CCDirector sharedDirector] openGLView] touchesBegan:touches withEvent:event];
( , UIScrollView Cocos2D, nextResponder: .)
Cocos2D:
CCNode.m
- (CGPoint)convertTouchToNodeSpace:(UITouch *)touch {
CGPoint point = [touch locationInView: [[CCDirector sharedDirector] openGLView]];
point = [[CCDirector sharedDirector] convertToGL: point];
return [self convertToNodeSpace:point];
}
- (CGPoint)convertTouchToNodeSpaceAR:(UITouch *)touch {
CGPoint point = [touch locationInView: [[CCDirector sharedDirector] openGLView]];
point = [[CCDirector sharedDirector] convertToGL: point];
return [self convertToNodeSpaceAR:point];
}
CCMenu.m
-(CCMenuItem *) itemForTouch: (UITouch *) touch {
CGPoint touchLocation = [touch locationInView: [[CCDirector sharedDirector] openGLView]];
touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation];
...
- UITouch locationInView: . UIView, . Cocos2D UIView: OpenGLView, OpenGLView (= touch view) . , , UIScrollView, "touch view" , OpenGLView.