0
votes

I currently have a UIView holding a UIScrollView.

I would like to change the container view to be a cocos2d scene holding a CCLayer.

Is it possible to just add the UIScrollView to the CCLayer? I have researched around regarding using a UIScrollView in cocos2d and it seems to be a problem.

What is the correct way to get a scrollview running inside a CCLayer, or rather to get a UIScrollview to control the scrolling of the CCLayer content, still keeping the CCLayer responsive to touch events?

1

1 Answers

1
votes

There`s 2 ways to make a cocos2d ScrollView like:

1) You can use CCMenuAdvanced class, that have a option to be a scrolled menu. But it don't have the same smooth scroll and bounce movements. You can download CCMenuAdvanced and its examples in https://github.com/cocos2d/cocos2d-iphone-extensions

2) You can add a normal menu inside a Scrollable Layer, using CCScrollLayer (https://github.com/cocos2d/cocos2d-iphone-extensions) or CCScrollView (CocosBuilder class).

If you are using CocosBuilder, i recommend you to add use CCScrollView and add a menu inside it. It is a bit tricky, but it will works nice (I'm using this in a new game in development)