Questions tagged [skreferencenode]

11 questions
6
votes
1 answer

Get child node of SKReferenceNode in SpriteKit SWIFT

I create a scene Case.sks (using Level Editor), inside one SKSpriteNode (name : square), and one SKLabel (name : label). In my main scene, GameScene.sks, I use a SKReferenceNode with "Case" for reference. I need to access to the "square" sprite from…
cmii
  • 3,556
  • 8
  • 38
  • 69
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
3
votes
0 answers

Add delay to SKEmitter or SKReference to Scene editor

I'm trying to sempificate some animation with scene kit. I want to achieve to have an SKEmitter to the scene after some delay. The SKEmitter has a limitated number of spawn emitter, so it is during just 1 second, but I want this animation after 2…
Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30
1
vote
2 answers

SpriteKit Scene referenced with SKReferenceNode does not load custom class

I have a GameScene.sks a custom class GameScene.swift which is connected via the Custom Class Inspector (on the right in Xcode). This is working fine. Now in the GameScene.swift where I want to reference another scene that I want to reuse in many…
1
vote
1 answer

Alter SKReferenceNode from GameViewController

I'm developing a game in Swift using the SpriteKit framework. In this app, I have GameScene.sks where my UI is presented. Within that .sks file there is an SKReferenceNode for the bottom-menu. The bottom-menu is going to change it's height if the…
theloneswiftman
  • 188
  • 1
  • 4
  • 17
1
vote
1 answer

Casting an SKSpriteNode in an SKReferenceNode

I've build a Scene1 in Xcode's Scene editor. And I've referenced another scene which has animation to this Scene1. Now, I'm trying to cast-out an SKSpriteNode which is inside an SKReferenceNode. The name of the SKSpriteNode that I'm trying to cast,…
Setera
  • 287
  • 2
  • 8
1
vote
1 answer

Cropping an SKReferenceNode

I have setup a SKScene to be used as an SKReferenceNode. The sled is an SKSpriteNode with a custom class defined in the reference node scene and all the dogs are children of the sled sprite. The custom class and using the reference node is all…
TheValyreanGroup
  • 3,554
  • 2
  • 12
  • 30
1
vote
2 answers

Swift/SpriteKit - Any way to pool/cache SKReferenceNodes?

Is there a way to pool/cache SKReferenceNodes in SpriteKit using Swift? I am creating a game using xCodes visual level editor. I am creating different .sks files with the visual level editor that I am than calling in code when I need to. I am…
crashoverride777
  • 10,581
  • 2
  • 32
  • 56
0
votes
1 answer

How do I access variables in Swift contained in a custom class on a SpriteKit Scene Editor Reference node?

First I would like to say that I am completely self taught following as many tutorials on the internet that I can find, so apologies in advance if there are certain concepts Im not too familiar with. Alright with that out of the way I'd like to…
Barney
  • 1
  • 1
0
votes
1 answer

Trouble using SKReferenceNode programmatically

I'm planning to make an arcade game in which the screen is divided in two halves. Each of this half's background can vary each time the player starts the game. I wanted to design my backgrounds into different .sks files, and then randomly load two…
gionti
  • 96
  • 5
-1
votes
1 answer

SpriteKit - Change SKReferenceNode coordinate system

I am currently working at a 2D endless runner in SpriteKit. I create new Level sequences using the Scene Editor and then add them as a SKReferenceNode to the main scene. The problem is, that I need to get the position of the single nodes inside of…