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 fine, my problem is i'm unable to "crop" the scene to only show N number of dogs. Its as if after dropping the reference node into another scene, that parent scene is ignoring the reference node's width/height parameters and just displaying everything in it. So the question is, is this possible? Or do SKReferenceNodes not adhere to the scene width and heights properties when used in a parent scene?
The first image is of the full view reference scene (70x425). Second image is of what the frame should look like when i change the height programmatically if I only want the bottom 2 dogs to be shown.
class SledTeam: SKSpriteNode {
var dogTeam = [Int]()
required init?(coder aDecoder: NSCoder) {
switch dogTeam.count {
case 7,8:
self.scene?.size.height = 425
break
case 5,6:
self.scene?.size.height = 335
break
case 3,4:
self.scene?.size.height = 260
break
case 1,2:
self.scene?.size.height = 190
break
default:
break
}
}
}