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
CCNode *node = [CCNode node]; | |
[node addChild:child1]; | |
[node addChild:child2]; | |
// ... | |
[node centerContentWithPadding:10 TotalWidth:[[CCDirector sharedDirector] winSize].width]; |
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
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window | |
{ | |
return UIInterfaceOrientationMaskAllButUpsideDown; | |
} |
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 <UIKit/UIKit.h> | |
@interface LandscapeNavigationController : UINavigationController | |
@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 "LandscapeNavigationController.h" | |
@implementation LandscapeNavigationController | |
-(NSUInteger)supportedInterfaceOrientations { | |
return UIInterfaceOrientationMaskLandscape; | |
} |
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
navController_ = [[UINavigationController alloc] initWithRootViewController:director_]; |
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
navController_ = [[LandscapeNavigationController alloc] initWithRootViewController:director_]; |
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 CustomScrollLayer : CCScrollLayer | |
@property (nonatomic, retain) CCNode *customPageIndicators; | |
+(id) nodeWithLayers:(NSArray *)layers widthOffset:(int)widthOffset pageSpriteFrameName:(NSString*)pageSpriteFrameName; | |
-(id) initWithLayers:(NSArray *)layers widthOffset:(int)widthOffset pageSpriteFrameName:(NSString*)pageSpriteFrameName; | |
@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 CustomScrollLayer | |
@synthesize customPageIndicators; | |
+(id) nodeWithLayers:(NSArray *)layers widthOffset: (int) widthOffset pageSpriteFrameName:(NSString*)pageSpriteFrameName | |
{ | |
return [[[self alloc] initWithLayers: layers widthOffset:widthOffset pageSpriteFrameName:pageSpriteFrameName] 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
@implementation NodeRenderer | |
+(id)renderTextureWithNode:(CCNode*)node width:(int)w height:(int)h | |
{ | |
return [[[self alloc] initWithNode:node width:w height:h pixelFormat:kCCTexture2DPixelFormat_RGBA8888 depthStencilFormat:0] autorelease]; | |
} | |
-(id) initWithNode:(CCNode*)n width:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat)format depthStencilFormat:(GLuint)depthStencilFormat { | |
if(self = [super initWithWidth:w height:h pixelFormat:format]) { | |
[self addChild:n]; |
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 NodeRenderer : CCRenderTexture | |
+(id)renderTextureWithNode:(CCNode*)node width:(int)w height:(int)h; | |
-(id) initWithNode:(CCNode*)n width:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat)format depthStencilFormat:(GLuint)depthStencilFormat; | |
@end |