- Home /
android screen problem
the background sprite gets disfigured when run on a phone.i have no clue why this is happening
this is what it looks looks in the editor\
http://s26.postimg.org/otorljgg9/Untitled.png
and here is what it looks like on some phones
http://s26.postimg.org/m0vk1ig3t/158d0374e80df9cfd22ec74ffe1320ac.jpg
Looks like your artwork is the wrong size for the phone.
since there is no fixed resolution for all phones,what do you suggest i do?
Answer by screenname_taken · Jun 12, 2014 at 05:06 AM
You need something a bit more flexible. Have your sky texture on a flat mesh, infront of it place another mesh with your grass and the gui above them. Or have multiple images to load depending on the aspect ratio you find.
Also we don't have any code to look. It doesn't look as if it's stretching itself, rather than copying itself and trying to cover the screen.
Answer by doggan · Jun 12, 2014 at 05:12 AM
Your background sprite is not the correct size for your phone resolution. The area on the bottom is most likely garbage left over in the framebuffer, since you probably have your camera clear flags 'off'.
Depending on your requirements, you can either:
1). Dynamically stretch your background to match the resolution of the screen vertically and horizontally (Screen.height, Screen.width). This will make the background texture fill entire screen, but it will be distorted. This may be ok for some backgrounds.
2). Dynamically stretch the background and maintain an aspect ratio. For example, you can stretch the background texture to take up the full width of the phone, and calculate the height of the texture by using the original aspect ratio of the texture. If you center the texture vertically, then depending on the device resolution, you will have areas of the screen that will not be filled in (example). You can choose to keep the letterboxing effect by setting your camera clear color to black, or you could do some other type of effect.
Your answer
![](https://koobas.hobune.stream/wayback/20220613151303im_/https://answers.unity.com/themes/thub/images/avi.jpg)