1

How do I display a vertically scrolling menu (a la Words-/Hanging-/Scramble-/Matching with Friends, Dice with Buddies, etc.) in Cocos2D 2.1? Is including UIKit in my project absolutely necessary? I've been trying several different combinations and none of them are straightforward or even remotely comprehensible to a newb like me. I've tried: 1) Starting with a Cocos2D template and adding UIKit to the project, 2) Starting with a UIKit project and adding Cocos2D, which is just as confusing.

To be clear about what I need, picture a "With Friends" game's menu screen. My app has the same layout, but I've been unable to get the scrolling matchmaking menu on screen. I have a Navigation Bar, a background image, but no scrollview. I need a scrolling menu to show the player's active games (player's turn, other players' turns, start new game, facebook, twitter, etc.) that scrolls underneath the NavBar, again just like in a with Friends game.

Why is this so difficult in Cocos2D? I'm getting ready to abandon all hope of using Cocos2D for the very simple animations my game requires and just taking the plunge into OpenGL ES because it "integrates seamlessly with Objective-C based Cocoa applications," according to Apple in their OpenGL programming guide. Then I read that it's tough to integrate UIKit with OpenGL and saw a ton of tutorials for it.

Is there no straightforward, native way to do this in any API/engine/discipline???

4

1 回答 1

2

You can use the cocos2d extensions to achieve this. They are available here,

https://github.com/cocos2d/cocos2d-iphone-extensions

For a scroll view there is CCScrollLayer, you may also be interested in CCMenuAdvanced which is a scrolling CCMenu.

于 2012-11-09T20:41:43.497 回答