Questions tagged [skspritenode]

An SKSpriteNode is a node that draws a textured image, a colored square, or a textured image blended with a color.

An SKSpriteNode is a node that draws a textured image, a colored square, or a textured image blended with a color.

SKSpriteNode is part of , a graphics rendering and animation infrastructure to animate arbitrary textured images, or sprites.

is available on iOS () and OS X ()

Click Here for Apple Docs.

1417 questions
9
votes
1 answer

Handling Multiple GestureRecognizers

I've run into an issue understanding UIGestureRecognizers. My goal right now is to have a set of GestureRecognizers to do different tasks, for example: override func viewDidLoad() { mainScene = GameScene(size: self.view.bounds.size) main =…
9
votes
0 answers

SpriteKit: SKSpriteNodes disappear from SKEffectNode after a few seconds

I'm working on a metaballs effect in SpriteKit. I have an SKEffectNode with a shader that compresses the colour range of its buffer. This effectnode has a hundred-odd SKSpriteNode as its children. The effect works great for a couple of seconds, but…
OliverD
  • 1,074
  • 13
  • 19
9
votes
3 answers

Swift SKSpriteNode with UIImage

I've a problem with creating an SKSpriteNode with an UIImage. I'm creating the assets I use for my App with PaintCode (PaintCode creates a Swift file with drawing methods and image methods which allow me to display the created images). My problem…
Blackhawk
  • 133
  • 1
  • 6
9
votes
1 answer

swift change SKSpriteNode image in SKScene class

I defined SKSpriteNode under SKScene class, how can i change the SKSpriteNode image afterwards, for example: class GameScene: SKScene { var player = SKSpriteNode(imageNamed: "player") } I want to change the image from "player" to "player1"…
user3752276
  • 221
  • 1
  • 5
  • 12
8
votes
1 answer

How do I create an image node in SpriteKit? Swift 4

Somebody told me in one of my other questions that SpriteKit was easier than UI. I searched online on how to get started with SpriteKit, and I got this: https://www.raywenderlich.com/145318/spritekit-swift-3-tutorial-beginners. I put the images in…
Lunbun
  • 359
  • 2
  • 14
8
votes
1 answer

How can I modify the size of SpriteKit nodes in Swift?

In my app, for one screen, I am setting the size and centering the background of a SpriteKit node. For example, I'm setting the size of the background subview as follows: backgroundNode.size = self.frame.size While this is working on the iPhone 6…
Samuel Folledo
  • 442
  • 6
  • 15
8
votes
1 answer

Swift / SpriteKit: How to create a water drop effect?

i wonder how the following effect could be made in Swift (SpriteKit). I think about adding some ShapeNodes and fill them with the background image with -yscale 1. But i think this effect was made somehow different, because the background image…
aignetti
  • 481
  • 1
  • 3
  • 14
8
votes
4 answers

What's the difference of setScale and size of SKSpriteNodes in SpriteKit and Swift?

I was trying to set the size of a SKSpriteNode from a PNG image (OK with that, just a: test = SKSpriteNode(imageNamed: "myImage") But when it comes to resize it, I'm not sure if I should use test.setScale or test.size. What's the difference and…
J Manuel
  • 3,010
  • 22
  • 39
8
votes
1 answer

How to copy SKSpriteNode with SKPhysicsBody?

I am curious about a situation that I came across today when trying to unarchive and copy a SKSpriteNode from one SKScene to another. In the output from the playground below you can see that both linearDamping and angularDamping or not being…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
8
votes
1 answer

How to progressively blur a SKSpriteNode's image using Sprite Kit?

Can someone provide an example of how to progressively blur a SKSpriteNode's image using Apple's Sprite Kit? For instance, let's say the user touches a button on the screen which will then trigger the background to slowly (i.e. progressively) blur…
blueicecream
  • 125
  • 1
  • 5
8
votes
3 answers

How do you move an IOS SKSprite at a consistent speed

Playing around with SKSprites in the IOS SpriteKit, and I basically want to have a sprite randomly move a certain direction for a certain distance, then pick a new random direction and distance.. Simple enough, create a method that generates the…
Speckpgh
  • 3,332
  • 1
  • 28
  • 46
7
votes
1 answer

Swift 2: Value of type 'Set' has no member 'anyObject'

I checked my old game and I want to update it in Swift 2.0. When I tried to fix it, Xcode found an error. Error is Value of type 'Set' has no member 'anyObject' on this line of code: var touch:UITouch = touches.anyObject() as!…
user5537162
7
votes
1 answer

No bundle for bundleID, SpriteKit

Every time i move to a specific scene in my SpriteKit game i get the following error in the console: no bundle for bundleID: (null) What could be the reason for that? ..Why always at that specific scene? Thanks
user3138007
  • 637
  • 1
  • 6
  • 19
7
votes
1 answer

Change SpriteNode PhysicsBody Size at Run Time

I want to be able to change a node's physicsBody height when the user swipes downwards, but have not been able to find out how to do this, beside resetting the entire physicsBody. When I originally load the node, I use the below code: …
Jarron
  • 1,049
  • 2
  • 13
  • 29
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
1
2
3
94 95