简体   繁体   中英

SpriteKit scene screen offset on iOS9 / Xcode7

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 Simulator screenshot:

在此处输入图片说明

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 scene zoomed out screenshot:

在此处输入图片说明

I created a new scene to see which details differ.

Scene in Xcode - first bad - second good:

在此处输入图片说明

在此处输入图片说明

Node in Xcode - first bad - second good:

在此处输入图片说明

在此处输入图片说明

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

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).

Question 1:

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"?

Question 2:

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

(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.)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM