简体   繁体   中英

How do you change the orientation of a scene in Xcode?

I am trying to build a game scene in Xcode. The default game scene is laid out in portrait orientation. I would like to build the scene in landscape orientation. There is an option panel to toggle device orientation in the storyboard file at the bottom of the editor when viewing the storyboard. I can't find a similar option panel in the .sks file for game scenes. Does this exist?

Normally, the game scene will adjust the size depending on the screen orientation. You can set the scene size itself by selecting the Scene in IB and then going to the Attributes Inspector. There you can set the size for the scene.

But, if you create a default game template in Xcode, you will notice that you can rotate the device for the included template and the scene resizes depending on the screen orientation and size.

Of course, this behaviour is based on the scene's scaleMode property. So depending on how you set the property, the behaviour might vary.

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