Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by shelo941 · Jul 28, 2014 at 12:41 PM · 2dresolutionbestpracticesaspectratio

How to deal with multiple aspect ratios

Hi, I'm developing a 2D puzzle like game. I want to target all iOS devices (iphone 4+ ,ipad 2+ and retinas) and as much android devices as possible. The problem is as you already guessed with resolutions and aspect ratios. How to deal with it, and what are the best practices. please share your experience and best approaches with this problem. My approach is , I'm building for 3:4 (the game is in portrait mode) aspect ratio with ipad retina resolution images and using orthographic camera. for different aspect ratios i resize orthographic camera , and as expected I get black bars at the top and bottom . aka pillarbox. so I'll just resize (scale Y) the main scene. (drop everything in an empty gameObject and scale it up). or add 2nd camera to deal with this black bars. But I need the best and the most correct way to deal with this problem , what's the best practices for 2D game development when targeting multiple resolutions,aspect ratios. I've searched the net and forum but couldn't find the CORRECT WAY.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Jul 28, 2014 at 02:52 PM 0
Share

In my opinion there is not a correct way. As a starting point, pick a few popular games similar to yours and view them on a few devices to see how they handle it (and if you like the way they handle it). Or simply pick a vision for how you want it to handle it and make it happen.

avatar image pako · Apr 05, 2018 at 07:18 PM 0
Share

I just use xAR$$anonymous$$, a reliable and well supported plugin from the Asset Store, which I thoroughly recommend:

https://www.assetstore.unity3d.com/en/#!/content/10563

(no affiliation)

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by UnityDeveloper2 · Apr 05, 2018 at 06:34 PM

The correct way is to consider the different aspect ratios at which your game will be played, and implement a strategy for how your game will be rendered for those aspect ratios. The three cases you need to manage aspect ratio for are your Game view, UI view, and zoom.

Firstly, letterboxing or pillarboxing your game view is 100% OK and windowboxing in exchange for pixel perfection is also 100% OK. Mobile games especially tend to have an approach of "I support aspect ratios in this range, and any additional pixels aren't used". The black bars can also be substituted for more thematic, non-black bars, i.e. have a background that occupies a much larger area than your default game screen. Fruit Ninja is an example of a game that has a custom pillarbox. In addition, an extra-wide screen could give a player a vision advantage which is arguably unfair so many games have a field of vision limiter which serves as a strategic element.

Secondly, consider how your UI should change in appearance due to device aspect ratio, which can range from a game score to a complex menu. Mounting a panel to the top right corner for example may give bad results on an ultra-wide screen. The most flexible solution is to render your UI using a separate camera. As an aside, your splash screen and opening menu are the easiest parts of the game for you to make aspect-ratio agnostic, as they are often separate scenes with fairly simplistic elements.

The final thing to consider, especially for mobile, is whether and how to handle zoom. Zoom is a powerful feature which engages a higher percentage of the pixels on screen to make your game more visually comprehensible. Implementation is highly game-dependent but is worth considering.

Fine-tuning specific components is beyond the scope of this answer, but as long as you handle these three cases your game should end up aspect-ratio resilient.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

everything stretched on iPhone 5 2 Answers

Problem with 2D sprites 0 Answers

I'm having trouble with my character when playing in unity, and when I build and run the game 0 Answers

Objects looks very pixelated 4 Answers

Problems assigning sprite's images 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges