All Data Structures Files Functions Variables Enumerations Enumerator Properties Defines
/Projects/Cogito/src/Layers/Menu/AboutLayer.m
Go to the documentation of this file.
00001 //
00002 //  AboutLayer.m
00003 //  Author: Thomas Taylor
00004 //
00005 //  The 'about' layer
00006 //
00007 //  16/12/2011: Created class
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         //create the menu buttons
00039         CCMenuItemImage *backButton = [CCMenuItemImage itemFromNormalImage:@"Back.png" selectedImage:@"Back_down.png" disabledImage:nil target:self selector:@selector(onBackButtonPressed)];
00040         
00041         // create menu with the items
00042         buttons = [CCMenu menuWithItems:backButton, nil];
00043         
00044         // position the menu
00045         [buttons alignItemsVerticallyWithPadding:winSize.height * 0.059f];
00046         [buttons setPosition: ccp(winSize.width * 0.2, winSize.height * 0.1)];
00047         
00048         // add the menu
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