I am creating a game in sprite kit using swift, and I am trying to be able to move the SKScene around with a finger because not all of the nodes fit within the scene. I have already created world, overlay, and camera nodes with this code.
override func didMoveToView(view: SKView) {
world = self.childNodeWithName("world")!
if !isCreated {
isCreated = true
// Camera setup
self.anchorPoint = CGPoint(x: 0.5, y: 0.5)
self.world = SKNode()
self.world.name = "world"
addChild(self.world)
self.cam = SKNode()
self.cam.name = "camera"
self.world.addChild(self.cam)
// UI setup
self.overlay = SKNode()
self.overlay.zPosition = 10
self.overlay.name = "overlay"
addChild(self.overlay)
}
I would like to be able to move the camera around by using a pan gesture with a single finger. How would I do this? Any help would be appreciated.