From c9337218ef1660360097928c753bde1c79775618 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Tue, 23 Aug 2011 07:52:24 -0400 Subject: Added scrolling to level selection screen Using http://www.xcombinator.com/2010/09/08/a-paging-uiscrollview-in-cocos2d-with-previews/ as a base, I was able to implement a paging scroller for the level selection screen so players can swipe through available levels and choose one to play. At this point, the level selection screen is practically done--the only other thing I want to add is a UIPageControl to interact with the scrolling and give the player an indication of how many levels there are. Refs #207 --- Classes/GameModeSelection.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Classes/GameModeSelection.h') diff --git a/Classes/GameModeSelection.h b/Classes/GameModeSelection.h index f6aaeff..f69ea37 100644 --- a/Classes/GameModeSelection.h +++ b/Classes/GameModeSelection.h @@ -7,17 +7,23 @@ // #import "cocos2d.h" +#import "GameModeSelectionDelegate.h" -@interface GameModeSelection : CCNode { +@interface GameModeSelection : CCMenuItem { NSString* name; NSString* location; BOOL unlocked; NSString* unlockCondition; + id delegate; } @property (readonly) NSString* name; @property (readonly) NSString* location; @property (readonly) BOOL unlocked; +@property (nonatomic,retain) id delegate; ++ (id)selectionWithName:(NSString*)name location:(NSString*)location filename:(NSString*)filename unlocked:(BOOL)unlocked; ++ (id)selectionWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename highscore:(int)highscore; ++ (id)selectionWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename unlockCondition:(NSString*)unlockCondition; - (id)initWithName:(NSString*)name location:(NSString*)location filename:(NSString*)filename unlocked:(BOOL)unlocked; - (id)initWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename highscore:(int)highscore; - (id)initWithName:(NSString *)name location:(NSString *)location filename:(NSString *)filename unlockCondition:(NSString*)unlockCondition; -- cgit 1.4.1