Hey (:
I'm currently working on a SpriteKit Playground (iOS Target), and everything works great on the Mac. But problems arose when I tryied it on my iPad. Without setting a scale mode, the scene get's completly distored. That's why I set the following ScaleMode:
gameScene.scaleMode = SKSceneScaleMode.aspectFit
But this comes with it's own problems. Since my scene is squared, I now get big black bars on top and on bottom of the scene. Setting a background color to the SKView doesn't change that.
And the far bigger problem is, that the aspectFit completly messes with my TapRecognizer. I check if a touch happend in the scen via:
gameScene.contains(location)
But, the touches that are recognized as contained in the gameScene are partly in these black bars, and only partly in the displayed scene. Clicking in the bottom quater of the displayed scene is not even recognized as clicks within the gameScene. I calculated some stuff and tried to add an offset, but it is always is off several pixels.
So, I now have several Questions:
1. Any idea how to get rid of those black bars?
2. Any idea how to fix the tap recognizer problem?
3. Do we have to support the iPad? I mean, these problems didn't arouse on the Mac, it works perfectly there. This doesn't mean that I don't wanna support the iPad, but if it is unneccessary, then I will spend my time in improving on the Playground iteself, rather than fixing stuff on the iPad
(PS: The whole code works great as iOS App. The TapRecognizer bug and black bars only appear within the Playground app).