Hello, so I'm making a 2d game that plays in the mobile's vertical position, what would be the best way to make it avaible on all platforms without having to resize it for each mobile's screen size? Thank you for taking your time to read this post!
If you don't mind having your assets scaled, then running on screens of different sizes are trivial. All you have to do is make sure that you leave some space horizontally to cater for some 'trimming' on narrower screen or extra space on wider screens. Have a play with the game mode window by resizing it while in game mode to see how it effects your game. If you want your art to be displayed in pixel perfect manner, then the complexity multiplies quickly. It would involve carefully tweaking the camera's ortho size, the sprites' PixelPerUnit against the target device's native resolution.
Yes, you will have lot of space to the right and left. You can quickly try this out in the in the game view by switching between 16:9 and 4:3, notice how it will maintain the vertical 'world space' but the sides will grow/shrink.
Yes, it will be scaled accordingly. See http://forum.unity3d.com/threads/or...tiple-resolutions-iphone.327723/#post-2131711
I've handled the issue of screen sizes and aspect ratios by ensuring my background / game area would fit within the size of most (maybe not all) screen sizes and then have a script on the camera that adjusts the orthographic value of the camera to fit the width of the background image. This then cuts of some of the top/bottom of the background which doesn't make any difference to game play and keeps all sprites looking as I intended.
This is what I use ( to fit to either width of height ) and seems to work ok for me (although not sure if it is the best, or correct way to be honest). Apply the script to a camera, then in the editor drag the sprite you want to size to into the relevant property. If you tick the Fit Width tick box it'll fit the camera to the width of the sprite, else it will scale to the height (in my case 98% of the height) Code (CSharp): using System; using System.Collections; using UnityEngine; public class CameraFit : MonoBehaviour { public SpriteRenderer spriteToFitTo; public bool FitWidth = true; void Start () { if(FitWidth) { Camera.main.orthographicSize = (float)((spriteToFitTo.bounds.extents.x * Screen.height) / (Screen.width )); } else { Camera.main.orthographicSize = (float)((spriteToFitTo.bounds.extents.y * Screen.width) / (Screen.width )) * 0.98f; } } }