- Home /
Resolution with GUI on Android
My game doesnt look the same on my android build as it does on the computer. There is a lot of extra space around the sides of my game on the android and the font is smaller. Not really sure why. In the editor everything is scaled perfectly and my gui objects are at the top of the screen. On the android they are smaller and down from the edge enough where its in the way. Has anyone come across this?
Answer by jcastaldo13 · Mar 11, 2015 at 12:32 AM
So I Fixed it. Im dumb. I forgot to set the anchors for the gui objects. Not sure why the text doesnt look right, thats still a mystery. So i doubled the text size on all my gui text and it looks much better.
Answer by TheFloatingSheep · Mar 10, 2015 at 10:41 PM
It's because of the pixel inset. LoL You will have to change the values for every GUI texture. But it doesn't work if you don't use a touch script, i know on android you can use OnMouseDown function too but without pixel inset you have no chance.
Set the Pixel Inset to: X:0 Y:0 W:0 H:0 The position: X:0.5 Y:0.5 Z:0 The Scale: X:1 Y:1 Z:1
For making a GUI Texture for a button and making it to stretch on any resolution: Just set every value from the Pixel Inset to 0
For making the same thing with a GUI Text: Disable the Pixel Correct CheckBox, that will make the text blurry, i know, but don't worry... It's blurry because the scale isn't normal. Just try to scale it until is isn't so blurry, and import another Font than the Default one, and clicking the imported font, and changing the resolution in the inspector to 500 and, after that you can adjust the size without blurring it whenever you want from the Font Size value ;D
And if you have problems with the 3D gameobjects, you will have to look in the unity documentation for Matrix Projection. Good Luck!
BTW, next time when you have a problem like this, search for another questions like your's because in the past 5 days i saw just this question. :| It's faster than waiting for an answer.
I have no idea what you're talking about. Did I mention I am using the New Gui from the unity 4.6 update. I looked for the answers elsewhere but I also got answers like this. Very confused.
Greetings,
Is there any other way to do this, besides removing the "Pixel Inset" values? I have used the pixel inset values to correctly place child object's positions, relative to their parent object, so that the "whole set" of images for an area, is drawn in the same away, and doesn't get messed up with resolution changes.
Now, I do see a very strange/odd look in my GUI when playing the game. Things are not quite lined up and strangely stretched in areas.
If I simply use the xyz positions, the items can look fine at a low resolution (when lined up) but look all wonky and away from each other in higher resolutions... (So I resorted to pixel inset adjustment... and it looks fine in the editor... )
Any thoughts?
Your answer
![](https://koobas.hobune.stream/wayback/20220613185744im_/https://answers.unity.com/themes/thub/images/avi.jpg)