Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. - (void)viewDidLoad
  2. {
  3. [self.activityIndicator startAnimating];
  4. [self authenticatePlayer];
  5.  
  6. self.skView.backgroundColor = [SKColor blueColor];
  7.  
  8. // During this time the grey screen is visible as the assets are being loaded and take ~1 second
  9. // self.skView.scene is NULL here so I cannot set the backgroundColor...
  10.  
  11. [GamePlayScene loadSceneAssetsWithCompletionHandler:^{
  12. [self.activityIndicator stopAnimating];
  13. self.activityIndicator.hidden = YES;
  14.  
  15. CGSize viewSize = self.skView.bounds.size;
  16.  
  17. self.gamePlayScene = [[GamePlayScene alloc] initWithSize:viewSize];
  18. self.adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
  19.  
  20. [self.skView presentScene:self.gamePlayScene];
  21.  
  22. }];
  23. ...
  24.  
  25. self.scene.backgroundColor = [SKColor blueColor];
  26.  
  27. - (void)viewDidLoad
  28. {
  29. [super viewDidLoad];
  30.  
  31. // Configure the view.
  32. SKView * skView = (SKView *)self.view;
  33. skView.showsFPS = YES;
  34. skView.showsNodeCount = YES;
  35. /* Sprite Kit applies additional optimizations to improve rendering performance */
  36. skView.ignoresSiblingOrder = YES;
  37.  
  38. // Create and configure the scene.
  39. GameScene *scene = [GameScene sceneWithSize:skView.bounds.size];
  40. scene.scaleMode = SKSceneScaleModeAspectFill;
  41. scene.backgroundColor = [UIColor blackColor];
  42.  
  43. // Present the scene.
  44. [skView presentScene:scene];
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement