The SKNode class is the fundamental building block of most Sprite Kit content. All visual elements in a Sprite Kit-based game are drawn using predefined SKNode subclasses.
Questions tagged [sknode]
331 questions
0
votes
1 answer
How can I keep a rotation count for a SKNode
I am trying to come up with a way to accumulate the rotation of a SKNode. For example, if a node is rolling down a hill (circular physics body), I want to know how many rotations it has made, or an accumulated angle. I will need it to increment when…

Nathan
- 139
- 10
0
votes
0 answers
SKAction moving Entire Screen
I'm using an array to keep track of all the tiles in my game and on a touch call this function -(void)moveTilesDown which is supposed to loop through all the tiles and find where there is an empty space, then move the tile above it down one…

user2975241
- 73
- 2
- 7
0
votes
1 answer
Xcode 5.0.2 - Attempted to add a SKNode which already has a parent:
I am attempting to add a particle effect in the touchesBegan method, so when the user touches the drawn sprite(SKSpriteNode), it draws the particle effect. However, I receive an error Attempted to add a SKNode which already has a parent:…

whfissler
- 1
- 1
0
votes
2 answers
Motion effect for SKNode
I'm getting int SpriteKit. And would like to know how to create motion effect on SKNode object.
For UIView I use following method :
+(void)registerEffectForView:(UIView *)aView
depth:(CGFloat)depth
{
UIInterpolatingMotionEffect…

haawa
- 3,078
- 1
- 26
- 35
0
votes
1 answer
How to obtain zRotation of a sprite relative to world coordinates?
For example if you have a rotated sprite, to which you add another rotated sprite, and so on. How would you determine the on-screen zRotation of a sub-sprite, or the "absolute" rotation of a sprite?

openfrog
- 40,201
- 65
- 225
- 373
-1
votes
2 answers
Cannot assign PhysicsBody and property to an SKSpriteNode?
I'm building a function in which a random variable will choose 1 in 4 SKSpritenode in an array and assign itself to it. However, that randomline, although appear as expected on the screen, does not contain any physicsbody property so it cannot be…

Khoi Le
- 3
- 4
-1
votes
1 answer
Why does Xcode TouchesEnded() topMost touched node always return child nodes rather than the parent node?
I have Subclassed SKSpriteNode as a MenuButton()
The MenuButton() contains 2 children:
SKSpriteNode (an Image)
SKSpriteNode (some text)
When the below runs, if the user touches part of the button containing the image or the text (the children of…

Ryann786
- 289
- 4
- 12
-1
votes
1 answer
Cannot detect touch on falling SKShapeNode // SpriteKite
I have a bomb spawner in GameScene.swift that adds SKShapeNodes to the Scene. Each SKShapeNode is a physics object that falls and has the name set to "bomb". I want to detect when the user touches these nodes (mid-fall using touchesBegan), but it…

user3903960
- 3
- 1
-1
votes
1 answer
How to add and remove a SKErmitterNode within a sequence?
I'm adding a SKErmitterNode from the update() function. I want to remove the SKErmitterNode after 2 seconds, therefore I made a sequence but in the sequence, I can´t add Nodes. And if I add the Node outside of the sequence it gets added over and…

Jack23
- 19
- 3
-1
votes
2 answers
SKSpriteNode moveTo:X for all in array
for (int i = 0; i < [playerCards count]; i++) {
int cardsLaid = i * (cardDisplay.size.width / 3);
CGPoint forPoint = CGPointMake((0.5 - (self.frame.size.width / 4)) + cardsLaid, 0.0);
playerCards[i]
…

user2415313
- 101
- 1
- 10
-1
votes
1 answer
Position of SKNode being changed
I have an object which inherits SKNode where I set its position to a certain point. I add the node to a layer and its position is still set to the same point. The node appears at (0,0) and later on in the completion block of one of its actions I see…

NMunro
- 1,282
- 4
- 18
- 33
-1
votes
1 answer
Trying to remove a sprite during intersection of the object and character in sprite kit
Good afternoon, using Xcode / Spritekit / OSX 10.9.1
I am set up 3 methods to call upon hearts in a tutorial I was trying to expand upon.
The hearts are displayed on the scene as follows:
-(SKSpriteNode*) healthContainer1 {
SKSpriteNode *heart1…

stickynugz
- 41
- 7
-2
votes
2 answers
Can I Attach a Label to a SKNode?
I am creating a game that needs to have a label be attached to a node because I am using it as a button and the button moves around. Does anyone know how to attach a label to a SpriteKit node?

Adit Dayal
- 5
- 1
-2
votes
1 answer
Swift detecting if a SKNode is a property of custom class
Hi I have a custom class, Ship, that has a property 'Parrent' that is an SKNode. When the class is initialized a bunch of nodes are added to that 'Parrent' making up the appearance of the class ship. 'Ship' has a method 'Explode' that shoots all of…

T Neate
- 403
- 2
- 6
- 18
-2
votes
1 answer
SKNodes vs Views?
I'm having trouble understanding the difference between these two concepts - they both seem to work in very similar ways and seem to be doing the exact same thing.
This is what I've understood so far:
Scenes:
Whats "on" the screen. The individual…

dfsdf
- 281
- 1
- 3
- 6