If the default anchor point for an SKScene is (0,0) then does that make the scene stick its top left corner to the top left corner of the device's screen?
Also, if so, what's an easy way to support multiple devices using one scene? For example the default scene size (1024, 768) just fits a landscape iPad such that if I put a node at (0,0) in the scene it appears at the bottom left corner. How do developers usually get around this?
Edit 1
I tried setting the scale mode of the scene to .ResizeFill
in didMoveToView()
:
let screenWidth = UIScreen.mainScreen().bounds.width
let screenHeight = UIScreen.mainScreen().bounds.height
print("Screen size: (\(screenWidth), \(screenHeight))")
print()
print("Scene size before setting scaling: (\(self.frame.width), \(self.frame.height))")
print()
self.scaleMode = .ResizeFill
print("Scene size after setting scaling: (\(self.frame.width), \(self.frame.height))")
This prints out:
Screen size: (667.0, 375.0)
()
Scene size before setting scaling: (1024.0, 768.0)
()
Scene size after setting scaling: (1024.0, 768.0)