iOS9 / Xcode7上的SpriteKit场景屏幕偏移 [英] SpriteKit scene screen offset on iOS9 / Xcode7

查看:74
本文介绍了iOS9 / Xcode7上的SpriteKit场景屏幕偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将SpriteKit项目从Xcode64移动到Xcode7,在iOS9模拟器中运行,屏幕内容被移动。 (在iOS8模拟器中运行时不会移动。)

I moved a SpriteKit project from Xcode64 to Xcode7, ran it in a iOS9 simulator and the screen content is shifted. (It is not shifted when running in iOS8 simulator.)

iOS9模拟器截图:

缩放Xcode7中的SpriteKit场景会缩放框架和具有不同中心的内容。当场景没有缩小或缩小时,它看起来很完美;但是缩小它看起来像这样:(注意黄色框架如何不再与节点对齐)

Zooming the SpriteKit scene in Xcode7 scales the frame and the content with different centers. When the scene is not zoomed out or in, it looks perfect; but with zoom out it looks like this: (note how the yellow frame is not aligned with the node anymore)

Xcode 7场景缩小截图:

我创建了一个新场景看哪些细节不同。

I created a new scene to see which details differ.

Xcode中的场景 - 第一次不好 - 第二次好:

Xcode中的节点 - 第一个坏 - 第二个好:

注意场景的锚点和场景的位置好的和坏的节点之间的节点是不同的on。

Note how the anchor points of the scenes and the positions of the nodes are differing between the good and the bad version.

我可以手动更改错误值以反映良好的值。这将涉及移动20到30个节点。我想准确地移动这些节点 - 比如说(384,512)。但是,只要使用鼠标,它们就会在某个分数位置(212.561而不是212)结束。

I can manually change the bad values to reflect the good values. This will involve moving 20 to 30 nodes. I would like to move these nodes exactly - say - by (384,512). However, just using the mouse they will end up at some fraction position (212.561 instead of 212).

问题1:

我可以按Xcode7中的特定点数移动一组选定的节点吗?

Can I move a group of selected nodes by a specific number of points in Xcode7?

或者:是否有指南我可以抢购吗?

Or: Are there "guidelines" to which I could "snap"?

问题2:

我可以导入/导出/保存为/ ...场景,以便事情好?

Can I import / export / save as / ... the scene, so that "things are good"?

(放大Xcode6.4保持黄色框架和节点对齐现在在Xcode7中,我想以某种方式导入场景,再次缩放将保持黄色框和节点对齐 - 希望这也能解决iOS9模拟器屏幕中的场景偏移。)

(Zooming in Xcode6.4 kept the yellow frame and the nodes aligned. Now in Xcode7 I'd like to import the scene in a way, that again zooming will keep the yellow frame and the node aligned - in a hope that this would also solve the scene offset in the iOS9 simulator screen.)

推荐答案

随着Xcode 7.2的发布,可以通过打开每个场景文件来解决问题( .sks )并保存一次。放大和缩小时,黄色框和内容(请参阅我的问题中的屏幕截图)再次与另一个很好地对齐。

With the release of Xcode 7.2 the issue can be fixed by opening each scene file (.sks) and saving it once. The yellow frame and the content (see the screenshots in my question) are again aligned nicely to another when zooming in and out.

这篇关于iOS9 / Xcode7上的SpriteKit场景屏幕偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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