Questions tagged [skview]

SKView is the UIView subclass Sprite Kit uses to render the currently presented scene's nodes onto. All nodes displayed by Sprite Kit are children (so to speak) of a SKView.

136 questions
27
votes
3 answers

Pausing a sprite kit scene

@property (SK_NONATOMIC_IOSONLY, getter = isPaused) BOOL paused; I found this line of code that I could add into my project, how would I pause my whole game? For example: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ for (UITouch…
temp
  • 639
  • 1
  • 8
  • 22
16
votes
7 answers

How to dismiss SKScene?

When Im finished with my SKScene is there a way to dismiss the SKScene from within my SKScene class? If not back in my Viewcontroller where I present my SKScene [skView presentScene:theScene]; is there a way to restart the scene or remove in from…
4GetFullOf
  • 1,738
  • 4
  • 22
  • 47
16
votes
4 answers

Render/Snapshot SpriteKit Scene to NSImage

Does anyone know how to "snapshot" a complete SKView or SKScene into an NSImage? We have been able to use the textureFromNode API to create an SKTexture from a node and all its children. But so far we can't figure out a way to extract the image…
poundev23
  • 807
  • 3
  • 11
  • 18
13
votes
2 answers

How to stop a audio SKAction?

Goal: I want to present a new scene: [self.scene.view presentScene:level2 transition:reveal]; and end the current background music in order to start the new background music (the new background music from level 2). TheProblem: Upon presenting…
MB_iOSDeveloper
  • 4,178
  • 4
  • 24
  • 36
12
votes
4 answers

Unable to set SKView backgroundColor

I have an issue where my SKView's background color (grey) is briefly being displayed before the scene is presented. I manually attempted to set it, both via the Storyboard editor and in my controller (self.skView.backgroundColor = [SKColor…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
11
votes
2 answers

How to take screen shot programmatically (Swift, SpriteKit)

I tried what ever was suggested but the output was a white,blank screenshot. Which leads me to assume that I haven't added anything to the view. Here's how I'm adding graphics to my view. The addChild method comes with the SpriteKit and it takes in…
htjohn
  • 422
  • 7
  • 21
11
votes
2 answers

Difference between paused property of SKScene and SKView

I am pausing my SKScene using the following code: self.paused = YES; However, according to this answer by Andrey Gordeev, one can also pause a scene using this line: self.view.paused = YES; I would like to understand what difference it would make…
ZeMoon
  • 20,054
  • 5
  • 57
  • 98
9
votes
2 answers

After Closing SKScene, Memory Remains High

I use a dispatch_once NSObject to create data pointers. So all game asset pointers are made when the main viewcontroller appears. In order to play a game, the user taps a UIButton corresponding to a particular level on a UIViewController. Let me…
El Tomato
  • 6,479
  • 6
  • 46
  • 75
7
votes
1 answer

SpriteKit - how to correctly pause and resume app

I have huge issue with my newest game for iPhone made with Games by Tutorials book's help. NOTE : method from SpriteKit- the right way to multitask doesn't work. So, in my ViewController.m file, I'm defining private variable SKView…
7
votes
2 answers

Converting radian angle to CGVector

Using Sprite Kit I am trying to set an SKPhysicsBody moving according to a given angle, so for example if you wanted the sprite to travel to the right you would specify 1.571 radians. To turn the specified angle into a velocity I am using the method…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
6
votes
2 answers

Storyboard can't find SKView in Xcode9?

I have an ordinary .sks file in Xcode9, TestScene.sks. Of course, you need an SKView to "hold" an .sks. If I manually construct the SKView in code in the usual way it works fine. (I've included a handy example of that at the bottom of this…
Fattie
  • 27,874
  • 70
  • 431
  • 719
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
5
votes
3 answers

How can I "Fold" a UIView in 3D along a line?

If you have a UIView Imagine the view being full of text, animations, a cat photo, a gradient, or indeed any of the stuff a UIView can be full of. It's easy to tilt it back to the left in 3D or back to the right .. (BTW I highly recommend the…
Fattie
  • 27,874
  • 70
  • 431
  • 719
5
votes
0 answers

gpus_ReturnNotPermittedKillClient Crash using SpriteKit in keyboard extension due to lack of lifecycle events to pause OpenGL

While trying to use SpriteKit in an iOS 8 keyboard extension, I have run into numerous crashes that only occur when using a physical device and not attached to the debugger. If the debugger is connected to device, or if running in the SIM,…
g_pass
  • 711
  • 7
  • 15
5
votes
2 answers

Integrating a SpriteKit view into a xib view

I have a view that I already created using a xib file. Now I would like to add some small elements to this view that would make use some of the physics animations from SpriteKit, so now I need an SKView. Is it possible to add an SKView as a Subview…
L. Desjardins
  • 1,465
  • 1
  • 12
  • 22
1
2 3
9 10