Background size for 2D Game in Android

Hello there, my name is Jose and I am new to Unity. Nice to meet you :smile:

I am trying to develop a very simple 2D game for my “Huawei Y300” (Unity3D). The first problem I am facing now is the next: since there are so many different devices with so many different screen sizes, pixel densities, etc., it is almost impossible for me to find a way to present to the user the right background (i.e. perfectly fitting their screen without loss of image quality).

I’ve been doing some researching and found that Android classifies screen sizes into (Small, Normal, Large, Extra-Large) and pixel densities into (Low, Medium, High and Extra-High). I am also aware of using density-independent pixels instead of actual pixels to avoid compatibility problems.

One way to tackle this problem I can think of is about creating the same background for each of the 4 different classifications (S, N, L, XL) and loading it by scripting (previously detecting what classification does user’s mobile phone corresponds to). Is this possible in Unity3D? Is there any other (easier, faster, better) way to solve this problem?

I need your help! Thank you very much. :wink:

In Unity, I am lost. No one has clear advice on what to exactly do. “Use pre-made things and alter them.”
In Android Studio what I did for the background/Image issue, was to scale each image from it’s original size to a fixed size, depending on screen resolution.
Usually in the onSizeChanged() method, it will return the width, height of the screen. From there, find a scale factor based on an average image size. I used 800x600, since it would get all the phone’s sizes until it got to tablet size. (Some phones may need to upscale alittle, but not much)
But I have not found anyone talking about this on the subject Android development. Hell, I don’t even know how to get a blank canvas up so I can drag and drop my Button Images onto it, and make the logic for them being pressed.