-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHelp.m
More file actions
29 lines (22 loc) · 844 Bytes
/
Help.m
File metadata and controls
29 lines (22 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#import "Help.h"
#import "Game.h"
#import "Menu.h"
@implementation Help
- (id)init {
if ((self = [super init])) {
SPImage *bg = [[SPImage alloc] initWithContentsOfFile:@"Help.png"];
[self addChild:bg];
SPTextureAtlas *UIAtlas = [SPTextureAtlas atlasWithContentsOfFile:@"UIAtlas.xml"];
SPButton *backButton = [SPButton buttonWithUpState:[UIAtlas textureByName:@"backBtn"]];
backButton.x = 115;
backButton.y = [SPStage mainStage].height - 53;
[backButton addEventListener:@selector(backBtnPressed:) atObject:self forType:SP_EVENT_TYPE_TRIGGERED];
[self addChild:backButton];
}
return self;
}
-(void) backBtnPressed:(SPEvent *)event {
Menu *menuScene = [[Menu alloc] init];
[(Game *)[SPStage mainStage] showScene:menuScene];
}
@end