This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool test = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* System Versioning Preprocessor Macros | |
*/ | |
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) authenticateLocalPlayer | |
{ | |
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; | |
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")) { | |
// iOS 6 | |
localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){ | |
if (viewController != nil) | |
{ | |
[navController_ presentViewController:viewController animated:false completion:nil]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "CCScrollLayer.h" | |
@interface ElasticScrollLayer : CCScrollLayer | |
@property float actionDuration, bouncePeriod; | |
+(id) nodeWithLayers:(NSArray *)layers widthOffset: (int) widthOffset actionDuration:(float)duration bouncePeriod:(float)period; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ElasticScrollLayer.h" | |
@implementation ElasticScrollLayer | |
@synthesize actionDuration, bouncePeriod; | |
+(id) nodeWithLayers:(NSArray *)layers widthOffset: (int) widthOffset actionDuration:(float)duration bouncePeriod:(float)period | |
{ | |
ElasticScrollLayer *layer = [[[self alloc] initWithLayers: layers widthOffset:widthOffset] autorelease]; | |
layer.actionDuration = duration; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface Item : NSObject | |
+(id) itemWithNode:(CCNode*)node; | |
-(id) initWithNode:(CCNode*)node; | |
// The view | |
@property (nonatomic, retain) CCNode *node; | |
// "Forwarding" stuff | |
@property (nonatomic,readwrite,assign) CGPoint position; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ScalableMenuItemImage : CCMenuItemImage | |
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3 target:(id) t selector:(SEL) s; | |
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation ScalableMenuItemImage | |
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3 target:(id) t selector:(SEL) s { | |
return [[[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 target:t selector:s] autorelease]; | |
} | |
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block { | |
return [[[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 block:block] autorelease]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface CCNode (centering) | |
-(void) centerContentWithPadding:(int)padding TotalWidth:(int)totalWidth; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation CCNode (centering) | |
-(void) centerContentWithPadding:(int)padding TotalWidth:(int)totalWidth{ | |
int contentWidth = 0; | |
for(int i=0; i < self.children.count; i++) { | |
CCNode *child = [self.children objectAtIndex:i]; | |
contentWidth += child.contentSize.width; | |
} | |
int currentX = (totalWidth - contentWidth) / 2; |
OlderNewer