therefore, I have a basic game setup, which can be found on the bitpacket link below:
Game link
I currently have a hard time understanding how to translate a node camera in relation to a scene layout.
The goal is for the camera to follow the player until it comes across an angular border defined by the size of the scene. In this particular test case setup, the scene size is 1000x1000 with a camera scale of 1.
The code below is used to reposition the camera when a new position is set to follow the symbol:
var cameraPosition: CGPoint { get { return CGPoint(x: camera!.position.x, y: camera!.position.y) } set { let cameraScale = CGFloat(1) let sceneScale = CGFloat(1)//CGFloat(1 - 0.44 + 0.05 /*possible rounding error adjustment*/) // let viewAspectRatio = CGRectGetWidth(view!.frame)/CGRectGetHeight(view!.frame) let newPositionValue = double2(x: Double(newValue.x * sceneScale), y: Double(newValue.y * sceneScale)) let scaledSceneSize = CGSize(width: size.width * sceneScale , height: size.height * sceneScale) //// scaledSceneSize.height = scaledSceneSize.height / viewAspectRatio let cameraSize = view!.bounds.size let scaledCameraSize = CGSize(width: cameraSize.width * cameraScale, height: cameraSize.height * cameraScale) let minX = 0//-scaledSceneSize.width * anchorPoint.x + scaledCameraSize.width / 2 let minY = -219//-scaledSceneSize.height * anchorPoint.y + scaledCameraSize.height / 2 let minValues = double2(x: Double(minX), y: Double(minY)) let maxX = 0//(scaledSceneSize.width * anchorPoint.x - scaledCameraSize.width / 2) //size.width - cameraSize.width / 2 let maxY = 219//(scaledSceneSize.height * anchorPoint.y - scaledCameraSize.height / 2) //- cameraSize.height / 2 let maxValues = double2(x: Double(maxX), y: Double(maxY)) let clampedPosition = clamp(newPositionValue, min: minValues, max: maxValues) camera!.position = CGPoint(x: (clampedPosition.x / Double(sceneScale)), y: (clampedPosition.y / Double(sceneScale))) } }
There is a tough value that currently matches the size of the desired scene, and I'm not sure how to get these results on a scale. Default Scale:
scene.scaleMode = .AspectFill
Without knowledge of the knowledge of translation there on a scale, by default, I would expect that the boundaries would be mostSceneDimensionXValue - cameraSize.width / 2 mostSceneDimensionYValue - cameraSize.height / 2
As an example of a high level. Can anyone help me get this translation?
In general, the scene should look like this in all angles: 
VS having a black background in the frame as such:
