SpriteKit Coordinates differ between iPad and iPhone

馋奶兔 提交于 2019-12-02 09:20:15

This is caused because the size of the screen on iPhone is incorrect - have a look in the scene's sks file, you should see the size of the scene is set to (1024, 768) by default. To correct this you need to set the scene size and scale mode:

scene.size = skView.bounds.size
scene.scaleMode = .AspectFill

You should do this is didMoveToView or when you instantiate the scene.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!