Skip to content

Instantly share code, notes, and snippets.

@veeneck
Created April 3, 2014 22:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veeneck/9964115 to your computer and use it in GitHub Desktop.
Save veeneck/9964115 to your computer and use it in GitHub Desktop.
Switch scenes in Sprite Kit
// Replace NAMEOFSCENE in code
-(void) switchScene {
SKTransition *reveal = [SKTransition fadeWithDuration:3];
SKScene *scene = [NAMEOFSCENE sceneWithSize:self.view.bounds.size];
scene.scaleMode = SKSceneScaleModeAspectFill;
[self.view presentScene:scene transition:reveal];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment