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
8
votes
0 answers

Properly setting the SKCameraNode's size/scale in a large SKScene

I'm wanting to create a simple game where you fly around a large game scene in SpriteKit, with a camera following the player. It will be a portrait-oriented game. What I'm wondering is how to properly set up the dimensions of the SKScene and…
iank
  • 800
  • 3
  • 10
  • 32
8
votes
1 answer

in app purchase in SKScene

Is it possible to implement an in-app purchase within the SKScene? If so, how? I'm trying to use a SKSpriteNode as a 'buy' button with no luck. I'm not sure whether the code needs to go in the SKScene or the view controller. I've looked at loads of…
JGrn84
  • 750
  • 1
  • 9
  • 26
7
votes
4 answers

Moving Camera in SpriteKit Swift

I am creating a game in sprite kit using swift, and I am trying to be able to move the SKScene around with a finger because not all of the nodes fit within the scene. I have already created world, overlay, and camera nodes with this code. …
Aidan Kaiser
  • 501
  • 5
  • 17
7
votes
1 answer

What's the best way to handle multiple SKScenes?

I made a game using the default new game project and then inserted a normal UIView as the app intro scene. I'vs since 'upgraded' the intro into using an SKScene, with buttons that push the original gameViewController onto the stack. It seemed a bit…
Designer023
  • 1,902
  • 1
  • 26
  • 43
7
votes
1 answer

Combine several SKScenes in Sprite Kit

I am currently struggling with the following problem: I am creating a Sprite Kit game in Objective-C, in which I have to use a parallax-animation in all 3 scenes. I use clouds with randomly generated X and Y positions. They appear in the greeting…
Objective D
  • 799
  • 5
  • 16
7
votes
2 answers

Using custom SKNodes in spritekit scene editor

I want to create a level using my custom subclasses of SKNode. I tried adding an SKNode to the scene editor and using the "Custom Class" tab give the class that I want it to be but that did absolutely nothing. The node would still be empty and…
Youssef Moawad
  • 2,846
  • 5
  • 28
  • 50
7
votes
5 answers

How to keep SpriteKit scene paused when app becomes active?

Is there anyway to prevent SpriteKit from automatically unpausing a scene when entering foreground/becoming active? I set paused = true and want it to remain so even when the app becomes active again after having been sent to the background. I…
Pinxaton
  • 437
  • 4
  • 13
7
votes
3 answers

How do I go from SKScene to UIViewController by code?

All I want if for when the user touches a skspritenode in the skscene, it will go to a different view like performseguewithidentifier. Thanks for any help. I can post code, but it seems like a generic question so I figured that you wouldn't need…
Dylan Vander Berg
  • 1,809
  • 1
  • 22
  • 37
6
votes
1 answer

When to use sceneDidLoad v didMove(to view:)

Can someone please help me understand the difference between sceneDidLoad and didMove(to view:) in a GameScene? I realize that didMove(to view:) is called once the scene is presented. While sceneDidLoad is called once the scene is initialized. So…
CMR
  • 101
  • 1
  • 10
6
votes
1 answer

Loading an SKNode from a .sks scene file in Swift

I want to use multiple .sks files to store some complex SKNode hierarchies such as game menus. I have a background with moving objects I'd like to keep throughout the game, so presenting different SKScenes doesn't achieve what I want. I am…
mogelbuster
  • 1,066
  • 9
  • 19
6
votes
1 answer

Simplest Way To Change Scene In Swift + Sprite Kit

I am just wondering what the simplest way to change scenes in Swift + Sprite Kit is?
user3808792
  • 103
  • 1
  • 2
  • 5
6
votes
4 answers

Make SKScene fill whole screen using Swift

I have the following in GameViewController.swift class GameViewController: UIViewController { override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() println(self.view.frame.size) var skView:SKView =…
ielyamani
  • 17,807
  • 10
  • 55
  • 90
6
votes
1 answer

removeFromSuperview doesn't work for UIView's added to SKScene

I am adding a UIView to the view of an SKScene. Later, when I wish to remove that UIView form its superview, using the standard method of uiview.removeFromSuperview does not seem to work. How should I be accomplishing this instead? Here is how I…
zeeple
  • 5,509
  • 12
  • 43
  • 71
6
votes
1 answer

Navigating between scenes in Sprite Kit?

Let's say I begin with a scene initialScene. This scene contains a few buttons. When the user taps Button A in this scene, I will present sceneA. So my code would look like this: sceneA* scene = [[sceneA alloc] init]; [self.scene.view presentScene:…
aanrv
  • 2,159
  • 5
  • 25
  • 37
5
votes
1 answer

Swift Audio Playback speed

I am developing a game where the main sprite is a spinning wheel. I would like to associate audio to the spinning wheel that changes pitch as the wheel slows down. When the wheel stops spinning I would like the sound effect to stop. Can someone…
Nick
  • 555
  • 2
  • 4
  • 13
1
2
3
43 44