Mobile setup screen resolution recommendations

Hi

So I want to setup a new mobile project that I will be deploying to iOS, Android, BlackBerry and Windows Phone.

What screen resolution should I start with, that will be best all around choice for all these platforms?

Thanks

1 Like

So to answer my own question, I finally realized that you don’t really need to work with screen resolutions for mobile.

For example for iOS and Android you can choose 16:9 or 4:3 (and 1:1 for BlackBerry) when testing in the editor. You then just need to make sure game looks proper and works right for those aspect ratios that you want to target and then let Unity worry about what happens after you Build it.

3 Likes

There’s also 5:4 and 16:10 :slight_smile:

As long as you have HD images for the larger resolutions, and controls follow the right edges/corners desired, you should be fine. You should probably get a few testers with different devices to be on the safe side.

1 Like

Okay so that brings up a good question …

What does “HD image” actually mean?

Is a background of 2048x2048 going to be sufficient for most mobile devices including tablets?

And what about say an image that is used as a button? How big will it resize until it becomes pixelated?

Just things I am wondering!

I’m only referring to buttons and such smaller elements here; a background DESIGNED to fill the entire screen would of course be more appropriate to create at the target resolution. But you’d probably want to go easy on huge images and tile smaller ones instead.

Buttons and icons could probably be designed at the highest resolution required in most cases, and scaled down for phones with lower resolutions. If you consider the resolutions of the devices you want to support, what is the smallest phone resolution? Mock up an image at that size, paste down some of your widget/icon art, and scale the image down until it looks roughly phone-sized on your screen. If you can still see the elements, it’s all good :slight_smile:

You can also get a rough idea of sizes for a Retina-style screen (2048x1536 and up) by mocking up an iOS interface in Xcode and looking at the sizes there. These are point sizes, so on a pre-Retina screen it’s pixels, on Retina it’s twice that size in each direction.

If VRAM could be an issue, you’d want to supply quarter-sized versions of all images for lower resolution devices (half width and size), and use whatever means are available to you to select the one appropriate for the current device. It depends on how much you want to bloat the package, and if you want to support anything but the newest, shiniest hardware.

Thanks orb …

Does Unity have any automatic way of choosing half-sized images at lower resolution? Or does this need to be programmed somehow via a script?

Thanks

It looks like there still isn’t anything automatic for it, but people suggest you read the Screen class to get the resolution/DPI and figure it out from there.

Okay, thank you for input.

So after playing around a little bit, I added the following code to Start() method of my GameController.cs script. It basically determines the left/right limits of player movement based on screen ratio.

//set player control limits to screen width
theScreenWidth = Screen.width;
theScreenHeight = Screen.height;
theScreenRatio = theScreenWidth / theScreenHeight; //this determines the screen ratio (3:4=iPad_Tall, 9:16=iPhone5_Tall, etc)

//NOTES
// The screen ratio calculations below are based on PORTRAIT mode (3:4 & 9:16 is for portrait mode). For LANDSCAPE mode you would need different numbers (4:3 & 16:9 is landscape mode).
// The player limit numbers I needed to work with in portrait were 7 for 3:4 and 5 for 9:16. So screen ratio of .75 needed to calculate to 7 and screen ratio of .5625 needed to calculate to 5, so that's where this weird formula below comes from.

theXMax = 7 - (10.67f * (.75f - theScreenRatio)); //Need theXMax values for screen ratio of 4:3(.75)=7 and for 16:9(.5625)=5

//set some min and max values regardless of screen ratio
if (theXMax > 9.9f) {
    theXMax = 9.9f; //Limit on boundary is 10
}
if (theXMax < 1.0f) {
    theXMax = 1.0f;
}

//set the range for player movement for 3:4 from +7 to -7 and for 9:16 from +5 to -5
theXMin = -theXMax;
playerController.boundary.xMax = theXMax; //set player boundary to right
playerController.boundary.xMin = theXMin; //set player boundary to left

So basically regardless of the screen ratio size, moving my player left to right will always go to the outer edge.

3 Likes