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

查看:24
本文介绍了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 中的节点 - 第一个坏 - 第二个好:

注意场景的锚点和节点的位置在好版本和坏版本之间是如何不同的.

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天全站免登陆