Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 561
Guru Avatar asked Dec 28 '25 16:12

Guru


1 Answers

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

like image 164
Ben Trengrove Avatar answered Dec 31 '25 18:12

Ben Trengrove