All Data Structures Files Functions Variables Enumerations Enumerator Properties Defines
/Projects/Cogito/src/Layers/BackgroundLayer.m
Go to the documentation of this file.
00001 //
00002 //  BackgroundLayer.m
00003 //  Author: Thomas Taylor
00004 //
00005 //  Handles the background of the game
00006 //
00007 //  13/11/2011: Created class
00008 //
00009 
00010 #import "BackgroundLayer.h"
00011 
00012 @implementation BackgroundLayer
00013 
00014 #pragma mark -
00015 #pragma mark Initialisation
00016 
00021 -(id)init 
00022 {
00023     self = [super init];
00024     
00025     if (self != nil) 
00026     {
00027         CGSize winSize = [[CCDirector sharedDirector] winSize];
00028         
00029         CCSprite *backgroundImage = [CCSprite spriteWithFile:kFilenameDefBG];
00030         [backgroundImage setPosition:CGPointMake(winSize.width/2, winSize.height/2)];
00031         [self addChild:backgroundImage z:0 tag:0];
00032     }
00033     
00034     return self;
00035 }  
00036 
00037 @end