Atlas images wrong size on iPad iOS 9

狂风中的少年 提交于 2019-12-10 22:31:11

问题


Since upgrading to iOS 9 I have this strange issue with image atlases in my SpriteKit game. In my game I have a StartScene, a MenuScene and a GameScene.

In all 3 scenes I am using atlases for my enemies so I can animate them. All worked fine on all devices but since upgrading iOS 9 it causes me issues on iPads.

On my iPad when I launch the game the enemies in StartScene are about 3 times as big as they should be. Whats strange is that when I move to menuScene or gameScene the enemies are normal size. When I tell my game to launch straight into MenuScene I have the same problem, enemies are way to big until I change to another scene. This happened as soon as I run my game on iOS 9 and even after I upgraded to swift 2 and Xcode 7 I am still having this issue.

Anyone seeing this too, I have no clue what could cause this and how to fix it. Is this just a terrible iOS 9 bug? Thanks for any help.


回答1:


I saw there's a new option in the Xcode assets. If you click on the plus sign and select Sprite Kit Asset, you may fix the problem.




回答2:


This was purely an iOS 9 bug and I believe was fixed. The initial code for my game was not doing any SKScene scaling, I did it all manually for every device, which was a terrible idea. Since asking this question I have change the way my scenes are scaled (AspectFill) so I am not 100% sure if this bug is still occurring.



来源:https://stackoverflow.com/questions/32505572/atlas-images-wrong-size-on-ipad-ios-9

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