- Home /
Android Screen Resolution
Hello everyone! Is there any way to have a GUI button in the same position in all android devices? I tried with screen.width - screen.height but it doesn't work. Any help is appriciated :)
There are a million different screen resolutions in the android world. The only way to have consistency is to use percentages of the screen width and height to place your controls.
Answer by hug0 · Aug 04, 2013 at 09:57 PM
If you are using GUI Textures you can put the Pixel Inset X,Y, to zero and change the position in the transform,
or if you are using a script function OnGui you can say to the gui have:
Screen.width/2 + x and Screen.hight/2 + y,
this makes the positioning is done taking into account the middle of the screen, X and Y are variables and you change this to have the final position.
Your answer
Follow this Question
Related Questions
Rendering GUI.Buttons in the middle of the screen 5 Answers
Auto scaling GUI 3 Answers
Player Screen Resolution 2 Answers
Fit GUI to various android screen resolutions and densities 6 Answers
NOT auto resizing GUI, keeping GUI always the same aspect ratio 0 Answers