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

SKSpriteNode loses its physicsBody properties

I'm using SpriteKit to create a game in which objects at the bottom of the map move. The objects are crocodiles and coins. The scene uses an NSTimer to that calls this selector: timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self…
user3157423
  • 51
  • 1
  • 4
0
votes
1 answer

CIFilter (CIStripesGenerator) with SKTexture?

I am trying to get a strips generated using CIFilter, then create a SKTexture from it. Here is my code. CIFilter *filter = [CIFilter filterWithName:@"CIStripesGenerator"]; [filter setDefaults]; [filter setValue:[CIColor colorWithRed:1…
walaa
  • 23
  • 4
0
votes
1 answer

SpriteKit iOS 7 Sknode not being removed

I am developing a game for iOS 7, and it uses Spritekit. The main skspritenode is a helicopter, and when this helicopter makes contact with a shrink bonus pickup, the helicopter shrinks to make navigation easier for the user. Here is the code for…
0
votes
1 answer

Sprite Game - Number of nodes (iPhone)

I was wondering if there was a simple way to determine the number of nodes in a given view, I have found the: NSArray *array = [self nodesAtLocation:CGPoint]; But would rather not do this for every point on the screen, I cannot find a simple way to…
0
votes
1 answer

iOS Spritekit Cannot Run SKAction on a Subclassed SKSpriteNode

For my question I would like a more conceptual answer rather than a code one. I have a iOS application using Spritekit. I have a class that subclasses a SKSpriteNode, so that I can add additional properties to the node. I am able to successfully…
0
votes
3 answers

How to add client data to SKNode / SKSpriteNode?

I'm using the IOS SpriteKit and wanted to know if there's some way of adding client data to a sprite node? For example I want to attach specific behaviour to a node, additional properties, relationships to other nodes etc. I'm reluctant to sub-class…
0
votes
2 answers

Add a SKSpriteNode to the main scene from another class which is not a view

So I have my main view where I can do things such as this: player = [Hero spriteNodeWithImageNamed:@"player.png"]; player.position = CGPointMake(512, 384); [self addChild:player]; This is done in the GameScene, which is my main scene, its loaded in…
user3143075
0
votes
0 answers

Rotation of SKSpriteNode grouped with its shadow

I am trying to perform some actions on a SKSpriteNode grouped with its shadow in a SKNode. Translation works correctly, but rotation is still a problem. I implemented adding shadow as follows: - (SKNode *) addShadow:(NSString *) nodeName…
Neslisah
  • 46
  • 1
  • 3
0
votes
1 answer

Incorrect work of SKPhysicsBody with moved SKSpriteNode anchorPoint?

Here is my code: // setting background _ground = [[SKSpriteNode alloc] initWithColor:[SKColor greenColor] size:CGSizeMake([Helpers landscapeScreenSize].width, 50)]; _ground.name =…
AndrewShmig
  • 4,843
  • 6
  • 39
  • 68
0
votes
1 answer

Current Position of SKSpritenode in method TouchesBegan

this is my first question i hope its just not too stupid, i've searched but couldn't find an answer, i hope you can help me! I create and add to my scene an SKSpriteNode, then i want to be able to know its current position in the method…
0
votes
2 answers

How to replace a SpriteNode with another

What Im Doing: I have bombs being set every few seconds through a repeating Timer, continuously calling the following method. //in my init method SKTexture *Bomb5 = [SKTexture textureWithImageNamed:@"Bomb5.gif"]; SKTexture *Bomb4 =…
4GetFullOf
  • 1,738
  • 4
  • 22
  • 47
0
votes
2 answers

SKPhysicsBody size with resizeToHeight

I have a problem with size of physics body after resize of his skspritenode. My code: backTop.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:backTop.size]; [backTop.physicsBody setAffectedByGravity:NO]; [backTop.physicsBody…
Alexandre Ouicher
  • 856
  • 1
  • 9
  • 15
0
votes
1 answer

SKTexture from UIImage looks different

I'm playing around with SpriteKit and I'm creating a SKTexture from an UIImage, then using SKSpriteNode to add the child to my SKScene (As a background), everything works fine, except that the UIImage looks very different from the original image,…
chroman
  • 1,534
  • 12
  • 18
0
votes
1 answer

Moving SKNodes and SKSpriteNodes

I have the following setup in my game: An SKNode with the name _backgroundLayer A repeating texture which I have added to the _backgroundLayer 9 times to make a larger background An SKSprite with the name levelButton, which is added to the…
μ4ρκ05
  • 585
  • 2
  • 5
  • 16
0
votes
1 answer

Multiple Collision Rect on single SKSpriteNode

How can I make multiple Collision Rects with a single SKSpriteNode? Like I am trying to develop a concept in which some fruits are falling from sky and a basket has to collect them. So when the fruits hit the side of the basket, it will have a…
Hassy
  • 5,068
  • 5
  • 38
  • 63