iPad iOS 9上的Atlas图片尺寸错误 [英] Atlas images wrong size on iPad iOS 9

查看:125
本文介绍了iPad iOS 9上的Atlas图片尺寸错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从升级到iOS 9之后,我的SpriteKit游戏中的图像地图集出现了一个奇怪的问题. 在我的游戏中,我有一个StartScene,一个MenuScene和一个GameScene.

在所有3个场景中,我都为敌人使用了地图集,因此可以为它们设置动画.一切在所有设备上都可以正常工作,但是自从升级iOS 9以来,这在iPad上引起了我的问题.

在我的iPad上启动游戏时,StartScene中的敌人大约是他们应有的敌人的三倍.奇怪的是,当我移动到menuScene或gameScene时,敌人的大小是正常的. 当我告诉我的游戏直接启动进入MenuScene时,我遇到了同样的问题,敌人会变得很大,直到我切换到另一个场景为止. 在iOS 9上运行游戏后,甚至在升级到swift 2和Xcode 7之后,我仍然遇到这个问题.

也有人看到了这一点,我不知道是什么原因引起的以及如何解决.这只是一个可怕的iOS 9错误吗? 感谢您的帮助.

解决方案

这纯粹是一个iOS 9错误,我相信已修复.我游戏的初始代码没有进行任何SKScene缩放,我为每台设备手动完成了所有操作,这是一个糟糕的主意.自问了这个问题以来,我改变了场景缩放的方式(AspectFill),所以我不确定100%是否仍在发生此错误.

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.

解决方案

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.

这篇关于iPad iOS 9上的Atlas图片尺寸错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆