Questions tagged [skscene]

An SKScene object represents a scene of content in Sprite Kit. A scene is the root node in a tree of Sprite Kit nodes (SKNode). These nodes provide content that the scene animates and renders for display. To display a scene, you present it from an SKView object. SKScene is Apple technology for use on iOS 7.0 and later.

An SKScene object represents a scene of content in Sprite Kit. A scene is the root node in a tree of Sprite Kit nodes (SKNode). These nodes provide content that the scene animates and renders for display. To display a scene, you present it from an SKView object.

A scene calculates the contents of a new frame by processing the following actions in order:

  • The scene calls its update: method.
  • The scene executes actions on its children.
  • The scene calls its didEvaluateActions method.
  • The scene executes any physics simulations on physics bodies in the scene.
  • The scene calls its didSimulatePhysics method.

Click Here for Apple's Documentation Reference for SKScene.

653 questions
0
votes
2 answers

The best way to implement lives and score count in Sprite Kit (static, IoC, other?)

I have background in Java but havn't been coding in years. Lately I've taken interest to warm my coding skills again and have chosen to create learning apps for my kids in Swift. I've created basic Swift game utilizing the Sprite Kit with…
user3673836
  • 591
  • 1
  • 9
  • 23
0
votes
1 answer

Moving from a scene to a view controller - Attempt to present ViewController whose view is not in the window hierarchy

I am working on an iPhone app using Storyboard and I need to handle view changes from one view controller to another one. I have: -INTROViewController.m -INTROscene.m (this is a SKScene laid out by the above…
jeddi
  • 651
  • 1
  • 12
  • 21
0
votes
2 answers

How using class func to call a method from another class in SWIFT

I would to call from the GameViewController my timer method (written in my GameScene) in order to pause the game with an UIButton initialized in GameViewController class. I'm trying to use a class func like this : class GameScene: SKScene,…
Haox
  • 608
  • 1
  • 7
  • 23
0
votes
0 answers

Sprites must be cleaned before switch scenes with SpriteKit and Swift?

There are two scenes(scene1, scene2) in my game, both of them have some sprites. scene1 will be presented at first with skView. scene2 will be presented with the same skView when the hero is stronger. In case the hero is weak, scene1 will be…
Sifeng
  • 713
  • 9
  • 23
0
votes
1 answer

Frame size iOS8 Sprite Kit

I am a SpriteKit beginner and did some tutorials under iOS7 and xcode5. The frame size is now, after the update to xcode6 and iOS8, fix for every device (1024,768). My questions is now how can I actually figure our what is shown in the Scene and in…
SirSandmann
  • 300
  • 5
  • 13
0
votes
0 answers

UITextField added to SKScene not appearing in swift

I am trying to add one UITextField to SKScene subclass, I referred this url: Adding textfield to SKScene Here they are doing it in objective c. I tried to do the similar thing in swift, by using below code: let playerNameTextField =…
Devarshi
  • 16,440
  • 13
  • 72
  • 125
0
votes
1 answer

Call Method from Another Class Not Working - iOS

I have this in my "GameScene.m" class (SKScene): GameViewController * game = [[GameViewController alloc] init]; [game imgMethod]; And I have this method in my "GameViewController.m" (UIViewController): - (void)imgMethod{ NSLog(@"test"); …
0
votes
0 answers

Get a list of all SpriteKit Scenes in App Bundle

As a followup to this question, I need to iterate over each .sks file in a folder, namely, "Levels". My project looks like this: Here's what I've written: let directory = NSFileManager.defaultManager().currentDirectoryPath let paths =…
michaelsnowden
  • 6,031
  • 2
  • 38
  • 83
0
votes
2 answers

Crash calling a ViewController implementing a SpriteKit scene

I am trying to call a viewcontrollerB from a viewcontrollerA with the following code: ViewControllerB *vc = [[ViewControllerB alloc]initWithNibName:nil bundle:nil]; [self presentViewController:vc animated:YES completion:nil]; Within the…
wrynux
  • 23
  • 5
0
votes
1 answer

Displaying a Game Center Directly from a SKScene

I've been trying to display a game center leader board over an SKScene for awhile now and I can't figure it out I've looked at multiple articles.. From Google and Here when i click on the button that brings you to this scene it brings you there and…
0
votes
0 answers

SpriteKit - Animating the scale of a SKScene has no effect

By implementing the following code I receive the following error message: SKScene: Animating the scale of a SKScene has no effect. _popup = [SKSpriteNode spriteNodeWithImageNamed:@"popup.png"]; [_popup.texture…
wrynux
  • 23
  • 5
0
votes
2 answers

Transition from ViewController to SKScene

I'm currently making a game in which the main game is a SKScene however the menu is a UIViewController. I have a button which when tapped should transition from the menu to the SKScene. What code should i write in the IBAction? I'm running xcode6…
0
votes
2 answers

Presenting SKScene BAD ACCESS crash

I'm building a fairly simple game in SpriteKit. This is my first experience with SpriteKit and so far it has gone smoothly. I have gotten to the point now that I want to present a new SKScene when the player completes the game. I'm getting a Bad…
0
votes
1 answer

Previous skscene is presenting without any call to present scene. Its like it was running in the background of my new scene

`SKView *skView = (SKView *) self.view; SKScene *scene = [MyScene sceneWithSize:skView.bounds.size]; scene.scaleMode = SKSceneScaleModeAspectFill; [skView presentScene:scene];` So MyScene is the homepage which you…
Rmalmoe
  • 993
  • 11
  • 13
0
votes
1 answer

iPhone- Spritekit Programming: Loading Scene from Button

I am new to the spritekit system. However, I have some questions. I have an app that has a menu screen, instructions page, etc..., none of which recquire me loading a skcene. However, I want to be able to load my "Game" scene on the press of a…
user2779450
  • 733
  • 1
  • 9
  • 19