cocos2d-iphoneccscrolllayer

Custom scroll in Cocos2D Layer


Please see image. How can I create custom scroll layer like this in cocos2D game? I used CCScrollLayer but that scrolls one page at a time. I want to scroll only one sprite on scroll.

Is it possible to do same with CCScrollLayer ? If not then is how can I do this?enter image description here


Solution

  • I have achieved a similar thing by overlaying a UIScrollView over top of my cocos2d scene and then following this answer. I like using UIScrollView's over CCScrollLayer because you get the nice bounce and it is not hard to add UIKit objects in cocos2d 2.0.

    Paging UIScrollView in increments smaller than frame size