Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to target as many devices as possible by providing a consistent experience. So I'm trying to make sure the aspect ratio fits each device it's played on.

After reading some forums and tutorials related to this topic I found that to create a game which runs without creating any black bars on the sides, I have to use multiple resolutions. So my question is how to use multiple resolutions in Unity 2D?

share|improve this question
    
Realted, possible duplicate: gamedev.stackexchange.com/questions/28034/…. Also, cross posting is discouraged. –  Byte56 Jan 23 at 3:54
    
I have found that 2D Toolkit has feature to apply multiple graphics . If anybody has information regarding that then please suggest me. –  Siddharth Jan 29 at 6:08

1 Answer 1

Asset resolutions and aspect ratios are two different problems. I don't have any experience with Unity, but this is a platform agnostic problem.

< Disclaimer > This is my approach - it might not be the best but it works fine for me. < /Disclaimer >


Asset size/resolution handling:

Have a few sets of predefined resolutions (for example: mobile, tablet, desktop and retina size).

Then you have two options:

  • include the right assets when building for the specific platform
  • include everything but load what you need based on the screen resolution

The first approach requires customizing the build/package process but it gives a significantly smaller file size. The second doesn't require any modifications to the build/package process but requires runtime logic to decide which asset to load and gives a bigger size. I would recommend the first one.


Aspect Ratio

This heavily depends on the type of game you're actually making. For a competitive game, you every player should see the same because you don't want to give advantage to users with a certain aspect ratio. The best way to achieve this is to take the most "extreme" ratio supported and model everything according to it. Usually, you lock either the horizontal or the vertical axis and fill the other with something visually appealing but non interactive. On a side scrolling example:

  • you decide that 16:9 is the most extreme resolution you support
  • lock the horizontal axis so it always fills the length of the device
  • on devices which have more vertical space (for example, 4:3) fill the top, bottom or both with extra non-interactive graphics
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.