Cocos2d provides the rather mundane CCMenuItemToggle
class to iterate through multiple CCMenuItem
choices. In this example, we'll spice this up with the LoopingMenu
class
that mimics the iPod Touch album art shuffling visual technique.
#import "LoopingMenu.h" @implementation Ch5_HorizScrollMenu -(CCLayer*) runRecipe { [super runRecipe]; message.position = ccp(70,270); /* Create 5 default sprites and 'selected' sprites */ CCSprite *book1 = [CCSprite spriteWithFile:@"book1.jpg"]; CCSprite *book2 = [CCSprite spriteWithFile:@"book2.jpg"]; /* CODE OMITTED */ CCSprite *book1_selected = [CCSprite spriteWithFile:@"book1.jpg"]; book1_selected.color = ccc3(128,128,180); [book1_selected setBlendFunc: (ccBlendFunc) { GL_ONE, GL_ONE }]; CCSprite *book2_selected = [CCSprite spriteWithFile:@"book2.jpg"...