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

Timer bar using scale SKAction, horrid SpriteKit rendering performance

I'm doing, what I think, is a very simple timer bar, with nothing else on the screen. Yet this can't maintain 60fps on an iPad Pro... am I doing something obviously heavy and wrong? let previewTime: TimeInterval = 3.0 func timerBar(){ let tbW:…
Confused
  • 6,048
  • 6
  • 34
  • 75
5
votes
1 answer

Better to make SKShapeNode or SKSpriteNode in spritekit game?

I make a game in spritekit, so make a some things in SKShapeNode and of course use SKSpriteNode's in my game. Which is better for fps and good for optimization of this game using SKShapeNode's or SKSpriteNode's?
Nurassyl Nuridin
  • 444
  • 4
  • 13
5
votes
2 answers

Add SKReferenceNode/SKScene to another SKScene in SpriteKit

I would like to add a SKScene to my main GameScene. SKReferenceNode seems to be a good solution. I have : - GameScene.sks (main scene) - Countdown.sks (scene to add to GameScene) - Countdown.swift (Custom class, how does to init it? SKScene ?…
cmii
  • 3,556
  • 8
  • 38
  • 69
5
votes
2 answers

SpriteKit SKPhysicsBody with Inner Edges

I have created an SKSpriteNode called let's say Map that has an edge path that I have defined (some simple polygon shape). What I am trying to figure out is how to add several other edge paths that would act as interior edges of the Map. As if the…
Will Von Ullrich
  • 2,129
  • 2
  • 15
  • 42
5
votes
1 answer

How to change SKSpriteNode size and colour in didBeginContact without SKTexture?

I have been changing SKSpriteNode colour and size within didBeginContact in the following way, using an SKTexture. if firstBody.categoryBitMask == spriteCategory && secondBody.categoryBitMask == enemyCategory { var newSprite =…
iGetIt
  • 695
  • 5
  • 20
5
votes
2 answers

Accessibility (Voice Over) with Sprite Kit

I'm attempting to add support for Voice Over accessibility in a puzzle game which has a fixed board. However, I'm having trouble getting UIAccessibilityElements to show up. Right now I'm overriding accessibilityElementAtIndex,…
Mason
  • 271
  • 2
  • 12
5
votes
1 answer

swift: converting SKShapeNode into SKSpriteNode -> No texture

I'm trying to convert SKShapeNode into a Sprite node by first converting the SKShapeNode into a texture. However the results is invisible sprite. The Physics body is there normally but no graphics are being displayed. Something wrong with the way I…
user3673836
  • 591
  • 1
  • 9
  • 23
5
votes
2 answers

Adding a visual effect to a SKSpriteNode when pressed

I am working on my first SpriteKit app in Xcode 6, coding in Swift. Now I have made some nice buttons from transparent png files. But I am trying to show a visual effect when the button is pushed. Example how I now show a static button: let…
Mr.Boon
  • 2,024
  • 7
  • 35
  • 48
5
votes
2 answers

Sprite Kit Remove SKNode From Parent When Off Screen

I would like to know how to remove my SKNodes when they are off screen to help my game run more smoothly. How To Do This On Sprite Kit Thanks So Much
user3773099
  • 73
  • 1
  • 3
5
votes
1 answer

physicsBody is misaligned with spriteNode

I am creating a spritenode, setting its position and changing its anchorpoint to (0, .5) and then creating a phyicsbody. The physicsbody thinks my anchorpoint is still at (.5, .5), stupidly. The same problem is referenced here, but unsolved:…
Max Hudson
  • 9,961
  • 14
  • 57
  • 107
5
votes
1 answer

iOS - bodyWithPolygonFromPath : Body is the same as the path but collisions are not working properly

First i'd like to say thanks to every users on this website because i'm always finding solutions here and it's sooo helpful ! I'm trying to make a game like Xonix, Bix or Jezzball with SpriteKit. Anyway, i have a ball bouncing against walls, and i'm…
user3198930
  • 138
  • 8
5
votes
1 answer

Is there a way to detect collisions between 2 SKSpriteNodes but allow them to overlap

I don't think there is a way to do this, but is there a way to detect when 2 SKSpriteNodes intersect with each other, but still allow them to overlap, so they don't actually bounce over each other? I know I can just have 1 without a physics body,…
Cocorico
  • 2,319
  • 3
  • 22
  • 31
4
votes
2 answers

Set a minimum rolling speed

I have a ball, which I fire into the air: And it is initialised like so: func initBallNode() { // TODO: Create ball node ballNode = SKSpriteNode(imageNamed: "Ball1") // Create a ball ballNode.zPosition = ZPositions.ball let…
George
  • 25,988
  • 10
  • 79
  • 133
4
votes
1 answer

Add gradient below SKShapeNode

I am working on a graph like this in watchKit. I have successfully draw line graph like above image according to custom data but I am unable to draw gradient below line graph like above image. here what I have done: var points = [CGPoint(x: 0, y:…
Tejas Ardeshna
  • 4,343
  • 2
  • 20
  • 39
4
votes
1 answer

SpriteKit: sprite looks blurry (with ghosting) at high velocity but fine at low velocity

When using high velocity (linear or angular) in SpriteKit, sprites look blurry as if there are "ghosts" trailing the sprite. The sprite looks fine at slow speeds. Below is a screenshot and GIF illustrating the blurriness/ghosting problem with high…
Crashalot
  • 33,605
  • 61
  • 269
  • 439