Mobile Screen Resize?

This is probably a basic question but… I was wondering how Unity handles mobile builds with relation to screen sizes? What I’m getting at is you do a build for, say an iPhone 5 for example, but someone on an iPhone 5s or 6 plays your game. Since those have a larger screen will the game automatically scale up to fill the entire screen? Or is that something you have to program yourself?

The camera fills the display vertically. So if there is a different aspect ratio (iPhone 4 (3:2), iPhone 5 and 6 (16:9), iPad (4:3) for example), then you will see more or less to the sides.

Have textures suitable for the largest resolution and allow Mip Mapping to cope with the lower number of pixels on other screens. Unless you are working with pixel perfect textures, in which case you might need to swap in different textures.

Sorry for the late reply I went to away to PAX Dev and Prime. I know there are build settings you can tweak with Unity but when making a game, whether it be 2D or 3D, if I know I want it to be a mobile game would I resize the camera to fit the dimensions of my intended target? Like if I planned to make a game for the iPhone should I resize my camera to some kind dimension that’s of 16:9 ratio?

No need to resize the camera you will see all your vertical height that’s visible by the camera (it will be scaled for the device) and it will just show you more width of your scene if you use a wide screen device. That means you have to have something there to be seen on wide screen device if one uses one. In other words your camera morphs the width of itself and scales the scene view-able on the device. Have a play and see what I mean.

Put a 1024 x 768 image on your scene and make the camera view it all.

On a square device you will see all the image to the edge of the screen.

On a wide device you will see the square image in the middle of the screen and some black to the left and right.

So what you need to do is have a background wide enough for a wide device but a square camera to start with where you have your action in case you are on a square device screen.

Having said that you can test the aspect ratio in game and re-position scores and game interface depending on the aspect ratio of the device and the cameras edge…

In a 2D game for instance you may have a background gameobject that stays the same size.
You may have a foreground object that has all the action happening that you want a bit bigger.

You may test the aspect ratio and decide I want to zoom in a bit and make things bigger so you resize your background and move your camera in a little bit to make the foreground bigger.

Pinch Zoom is a good example of why you would do this.

If you have any questions I have gone right through this whole scenario developing an app for all resolutions. In the end it was simple. The hardest part for me in my game was setting pinch zoom limits and dynamically resizing the backdrop.

1 Like