Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad
- {
- [self.activityIndicator startAnimating];
- [self authenticatePlayer];
- self.skView.backgroundColor = [SKColor blueColor];
- // During this time the grey screen is visible as the assets are being loaded and take ~1 second
- // self.skView.scene is NULL here so I cannot set the backgroundColor...
- [GamePlayScene loadSceneAssetsWithCompletionHandler:^{
- [self.activityIndicator stopAnimating];
- self.activityIndicator.hidden = YES;
- CGSize viewSize = self.skView.bounds.size;
- self.gamePlayScene = [[GamePlayScene alloc] initWithSize:viewSize];
- self.adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
- [self.skView presentScene:self.gamePlayScene];
- }];
- ...
- self.scene.backgroundColor = [SKColor blueColor];
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- // Configure the view.
- SKView * skView = (SKView *)self.view;
- skView.showsFPS = YES;
- skView.showsNodeCount = YES;
- /* Sprite Kit applies additional optimizations to improve rendering performance */
- skView.ignoresSiblingOrder = YES;
- // Create and configure the scene.
- GameScene *scene = [GameScene sceneWithSize:skView.bounds.size];
- scene.scaleMode = SKSceneScaleModeAspectFill;
- scene.backgroundColor = [UIColor blackColor];
- // Present the scene.
- [skView presentScene:scene];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement