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

Random Spawning in certain locations

How can you spawn SKSpritenodes randomly inside other SKSpritenodes? Maybe using constraints (in Swift)? For example, I would like circles to spawn in random places inside different square SKSpriteNodes.
MattJB
  • 13
  • 6
-2
votes
1 answer

Custom Init() translation from Objective-C

Sorry for a newbie question but can someone help with translating this to Swift? -(instancetype)init { self = [super initWithImageNamed:@"character.png"]; {. self.name = playerName; self.zPosition = 10; } return self; } it's for a…
Sawyer05
  • 1,604
  • 2
  • 22
  • 37
-3
votes
1 answer

Sprite/P5- count how many times an object hits another

I'm trying to build pong where after the ball hits the paddle x amount of times, a Christmas animation will appear. I'm not sure how to register this though, as well as if I should use an if else to switch to the animation. Stackoverflow won't let…
-3
votes
2 answers

Programmatically made buttons conflict with viewController’s gesture recognizers

Referring to my last question: Spritekit: passing from UIButtons to buttons as SKSpriteNode I’m working on a SpriteKit game: the user can tap and swipe on the screen to move sprites inside the scene and I added gesture recognizers in my…
DaniChi
  • 301
  • 3
  • 12
-3
votes
1 answer

BAD_ACCESS code=1

Problem Running this error consistently. This exact code works fine in another application so I'm doubting it's the issue. -(void)didMoveToView:(SKView *)view { self.anchorPoint = CGPointMake(0.5, 0.5); self.backgroundColor = [SKColor…
user2415313
  • 101
  • 1
  • 10
-4
votes
1 answer

I am trying to create and spawn multiple instance of SKSpriteNode

I am getting an thread exception at planes.append(plane). I don't know what seems to be the problem. click on the link for code page error at planes.append(plane) https://i.stack.imgur.com/3cxA2.png
-4
votes
1 answer

I want to add a button in my game using swift

So in my code I want to add an SKSpriteNode that I can use as a button to transition onto another scene, so could you possibly show me how I do that without using gameScene.sks
1 2 3
94
95