简体   繁体   中英

Should SpriteKit games support both portrait and landscape orientations? Or, should they support only one of those orientations?

Here's some background:

I was fooling around with SKShapeNode/SKSpriteNode objects by assigning them volume-based SKPhysicsBody objects, and I wrapped their enclosing scene with an edge-based SKPhysicsBody. The objects interact as expected when under the influence of gravity, applied forces, and in-game collisions.

The problem occurs when the simulator's orientation changes. So far, I've been using the .resizeFill value for the scene's scaleMode property. The results of using this value have been inconsistent. The nodes tend to be misplaced or fall out of the scene's bounding SKPhysicsBody edge object.

So, I am wondering if making SpriteKit games for both portrait and landscape is a good idea? Should SpriteKit games be limited to one orientation? I would like to know the general rules (ie best practices) for making these decisions.

Most of what you are asking falls under the 'should be closed / too broad' category: basically it depends on what your app needs to do so we can only give opinions.

However to answer one fundamental part: it is perfectly acceptable (and good practice if it fits your desired functionality) to make your app only support one interface orientation.

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