Ok, so I implemented a scrollview by using this method:
How to create a vertical scrolling menu in spritekit?
Now when I launch the scene it doesn't display anything except a black/ grey background
Here is the code I have used in the menu scene:
import Foundation
import SpriteKit
import UIKit
//let kMargin: CGFloat = 40
//var backButton = SKSpriteNode()
//var selectButton = SKSpriteNode()
var moveableNode = SKNode()
var scrollView: CustomScrollView!
private var imageSize = CGSize.zero
var sprite = SKSpriteNode()
class Menu: SKScene {
func didMoveToView() {
addChild(moveableNode)
scrollView = CustomScrollView(frame: CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height), scene: self, moveableNode: moveableNode)
scrollView.contentSize = CGSizeMake(self.frame.size.width, self.frame.size.height * 2)
view!.addSubview(scrollView)
sprite = SKSpriteNode(color: SKColor.redColor(), size: CGSize(width: 50, height: 44))
sprite.position.y = CGRectGetMidY(self.frame) + self.frame.size.height
moveableNode.addChild(sprite)
}
}
It might be really obvious but I can't seem to see it.