/
OLViewController.m
55 lines (44 loc) · 1.19 KB
/
OLViewController.m
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// OLViewController.m
// OLTTSpriteDemo
//
// Created by Ali Shahriyari on 8/19/13.
// Copyright (c) 2013 Originate. All rights reserved.
//
#import "OLViewController.h"
#import "OLMyScene.h"
@implementation OLViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Configure the view.
SKView * skView = (SKView *)self.view;
skView.showsFPS = YES;
skView.showsNodeCount = YES;
// Create and configure the scene (double the size to fit more into the view)
CGSize viewSize = self.view.bounds.size;
viewSize.height *= 2;
viewSize.width *= 2;
SKScene * scene = [OLMyScene sceneWithSize:viewSize];
scene.scaleMode = SKSceneScaleModeAspectFill;
// Present the scene.
[skView presentScene:scene];
}
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return UIInterfaceOrientationMaskAllButUpsideDown;
} else {
return UIInterfaceOrientationMaskAll;
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
@end