-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModeSelectionPopup.m
More file actions
36 lines (30 loc) · 1.06 KB
/
ModeSelectionPopup.m
File metadata and controls
36 lines (30 loc) · 1.06 KB
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
30
31
32
33
34
35
36
//
// ModeSelectionPopup.m
// mingame
//
// Created by Jason Baker on 9/1/17.
// Copyright © 2017 Jason Baker. All rights reserved.
//
#import "ModeSelectionPopup.h"
#import "GameObjectSelectionPopup.h"
@interface ModeSelectionPopup()
@property (strong) UIButton * objectButton;
@end
@implementation ModeSelectionPopup
- (instancetype)init {
self = [super init];
if (self) {
self.objectButton = [self addButtonWithData:@"object" sprite:nil];
[self addButtonWithData:@"play" sprite:[UIImage imageNamed:@"play.png"]];
[self addButtonWithData:@"save" sprite:[UIImage imageNamed:@"save.png"]];
[self addButtonWithData:@"trash" sprite:[UIImage imageNamed:@"trash.png"]];
[self addButtonWithData:@"share" sprite:[UIImage imageNamed:@"erase.png"]];
[self resizeToFitButtons];
}
return self;
}
- (void) updateButtonFromCurrentObject {
UIImage * sprite = (self.currentObject == nil) ? nil : [self.currentObject getCurrentSprite];
[self.objectButton setBackgroundImage:sprite forState:UIControlStateNormal];
}
@end