问题描述
一直都很好,直到我升级到xCode 7和iOS 9 ....我目前的项目是一个2D平台游戏,从升级到我我们许多人似乎正在面对的精灵套件错误/错误的下降的家禽。
我的问题是,所有的精灵都是以每个zPosition位置的形式随机出现的游戏在模拟器或设备上运行的时间。我一直在练习一个答案,没有运气,到目前为止我已经尝试了。
- 将所有图像移动到.xcassets
- 将构建设置下的iOS开发目标更改为iOS 9.0
- 更改代码中的所有图片以包含其扩展名,即background.png
仍然有同样的问题,图像层本身显然是随机的,任何人都可以推荐一个修复或其他可能的解决方案,我可能错过了?
谢谢。
由于@ tobias-lott在他的评论中提到,我不得不将zPosition包含在每个Sprite中,而不是让代码对sprite进行排序。
Everything was going so well until I upgraded to xCode 7 and iOS 9....
My current project is a 2D platform game, ever since the upgrade I've fallen fowl of the sprite kit bug/errors that many of us seem to be facing.
My issue is that all sprites appear randomly in terms of their zPosition position each time the game runs on either simulator or device. I've been scouring stack for an answer without luck, so far I've tried.
- Moving all images to .xcassets Like described here
- Changing the iOS Development Target to iOS 9.0 under Build Settings
- Changing all images in code to include their extension i.e. "background.png"
I still have the same problem where the images layer themselves apparently randomly, can anyone recommend a fix or some other possible solutions I may have missed?
Thank you.
As @tobias-lott mentioned in his comment I've had to bow include zPosition to every Sprite rather then letting the code order the sprites.
这篇关于iOS9 Sprite Kit问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!