Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #import "AboutLayer.h"
00011
00012 @interface AboutLayer()
00013
00014 -(void)onBackButtonPressed;
00015
00016 @end
00017
00018 @implementation AboutLayer
00019
00020 #pragma mark -
00021 #pragma mark Initialisation
00022
00027 -(id)init
00028 {
00029 self = [super init];
00030
00031 if (self != nil)
00032 {
00033 CGSize winSize = [CCDirector sharedDirector].winSize;
00034 CCSprite *background = [CCSprite spriteWithFile:@"AboutBackground.png"];
00035 [background setPosition:ccp(winSize.width/2, winSize.height/2)];
00036 [self addChild:background];
00037
00038
00039 CCMenuItemImage *backButton = [CCMenuItemImage itemFromNormalImage:@"Back.png" selectedImage:@"Back_down.png" disabledImage:nil target:self selector:@selector(onBackButtonPressed)];
00040
00041
00042 buttons = [CCMenu menuWithItems:backButton, nil];
00043
00044
00045 [buttons alignItemsVerticallyWithPadding:winSize.height * 0.059f];
00046 [buttons setPosition: ccp(winSize.width * 0.2, winSize.height * 0.1)];
00047
00048
00049 [self addChild:buttons];
00050 }
00051 return self;
00052 }
00053
00054 #pragma mark -
00055
00059 -(void)onBackButtonPressed
00060 {
00061 [[GameManager sharedGameManager] runSceneWithID:kMainMenuScene];
00062 }
00063
00064 @end