|
|
@ -72,6 +72,21 @@ |
|
|
|
- (void)setupGL{ |
|
|
|
[EAGLContext setCurrentContext:self.context]; |
|
|
|
game = [[Game alloc] init]; |
|
|
|
|
|
|
|
CGFloat x = 20; |
|
|
|
CGFloat y = 20; |
|
|
|
for (NSString * a in game.actions) { |
|
|
|
UIButton *myButton = [[UIButton alloc] initWithFrame:CGRectMake(x, y, 200, 22)]; |
|
|
|
[myButton setTitle:a forState:UIControlStateNormal]; |
|
|
|
[myButton addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside]; |
|
|
|
[self.view addSubview: myButton]; |
|
|
|
|
|
|
|
y += 22; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
- (void) action:(UIButton*) sender{ |
|
|
|
[game action:[sender titleForState:UIControlStateNormal]]; |
|
|
|
} |
|
|
|
|
|
|
|
- (void)tearDownGL{ |
|
|
|