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
1 answer

How do prevent iAds from resizing my view, and how do I turn iAds on/off from an SKScene?

In my ViewController, when I set self.canDisplayBannerAds = YES; the banner ad resizes my SKScene to fit the iAd view in at the bottom of the screen. This causes things to shift around and be displayed differently (parts of my background are cut…
0
votes
1 answer

Adding a UIScrollView to an SkScene/SkView

TL;DR: I have a SpriteKit game that looks great in 4' screens, need a quick fix (like using a scrollview to contain a SKScene) for 3.5' screens without coding everything again, thanks! I currently finished a game I was working on SpriteKit and I'm…
romsearcher
  • 340
  • 5
  • 19
0
votes
1 answer

How to dismiss/remove SKScene and View Controllers?

i have 3 view controllers. VC1(initial & home screen), VC2(SKScene & game), VC3(UIViewController & Gameover screen). My problem is when i start with VC1, then go to VC2 and then move to VC3 and then back to VC1, they all stack up on top of each…
0
votes
1 answer

ERROR: whose view is not in the window hierarchy. Spritekit

I will try to explain this best i can. Okay i am using SpriteKit in xcode5. Inside Myscene.m i have a method called: -(void)presentViewController { UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; …
ncd275
  • 1
  • 3
0
votes
0 answers

How do I make a non-SpriteKit menu that transitions to a SpriteKit scene in OS X?

I am creating an OS X game and for my menu screen I would like to use UI elements like Pop Up Button cells, checkboxes, etc for my settings screen. How would I go about transitioning my view from the settings screen (a non-SpriteKit view) to a…
02fentym
  • 1,762
  • 2
  • 16
  • 29
0
votes
0 answers

How to not run scenes in the background spritekit

I have a game with a menu scene, a play scene, and a game over scene. When I am on one of them is there a way to not run the others in the background. For example on my play scene when you make contact with something it switches to the game over…
user3762780
  • 45
  • 1
  • 6
0
votes
0 answers

When I try to switch to a new SKScene the scene gets smaller

I am trying to create a game where you have to jump over obstacles. If you hit the obstacle it changes to a different scene with score but that scene is just as wide but not as tall and I don't know why? This is my code: SKScene *newScene =…
user3762780
  • 45
  • 1
  • 6
0
votes
1 answer

Can't dismiss view controller after presenting from SKScene

I'm trying to reach a settings screen from SKScene. This is how I present the settings controller: let storyboard = UIStoryboard(name: "Main", bundle: nil); let settingController: UIViewController =…
junyi00
  • 792
  • 3
  • 8
  • 28
0
votes
1 answer

Sprite kit does not resume after pausing

My game uses physics and I do pause it successfully but I cannot resume it. The nodes are actually falling objects and when pausing they stay in air and all the physics is gone as expected when pausing a scene. But when I resume they stay in air and…
snksnk
  • 1,566
  • 4
  • 21
  • 46
0
votes
1 answer

can anyone give me example of call method of skscene class from sknode class

In MyScene class subclass of SKScene - (void)increaseScoreBy:(float)amount { score += amount; scoreNode.text = [NSString stringWithFormat:@"Score:%1.0f", score]; } In employee class subclass of SKNode MyScene *objmyscene; [objmyscene…
Tejas Ardeshna
  • 4,343
  • 2
  • 20
  • 39
0
votes
1 answer

Animate the background colour of a SKScene

Is it possible to do this? Using UIView animations doesn’t work, as expected. Currently, I’m using about 80 different sprites which animate, which is a big memory issue as well as much more complex to create so many images then import and code them…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
0 answers

Unpause SKScene after UIAlertView barges in

Does anyone else know how to solve this? When a SKScene is running, it is forced into pause state if an UIAlertView (or similar object) barges in. When I'm the one who fired the alert it's easy to unpause the scene, I just handle the delegate…
Larpus
  • 301
  • 1
  • 3
  • 17
0
votes
1 answer

Setting a universal size for a scene in Sprite Kit

In the documented SK programming guide by Apple the first displayed scene is "executed" by this code in the ViewController: - (void)viewWillAppear:(BOOL)animated { HelloScene* hello = [[HelloScene alloc] initWithSize:CGSizeMake(768,1024)]; SKView…
user3545063
  • 681
  • 8
  • 17
0
votes
0 answers

Completely Remove SkView and Push new SkView

SKview A holds SKscene A, have a button that removes SKview A SKscene A and at the same time pushes SKview B that holds SKscene B. :) Thank you so much for the help!!!
Xofear
  • 210
  • 1
  • 8
0
votes
1 answer

How to display UIActivityViewController from within Sprite Kit Scene

I am trying to present a UIActivityViewController within a Sprite Kit scene to share the users high score. I am using a SKSpriteNode as a button. My code: MyScene.h @property (nonatomic, weak) ViewController * spriteViewController; …
djames04
  • 11
  • 2