- Home /
Resolutions
Hi guys, a have i little doubts about the resolutions. I've created my application, and then i run it on 800x600, the GUI elements was "messed", how can i do to make one code to care about all resolutions?
Even i try to do this, i failed D=
void Start() {
screenX = Screen.width/2;
screenY = Screen.height/2;
}
void onGUI() {
public void createBox(float left, float top, float width, float height, string content) {
GUI.Box(new Rect((screenX-screenX)+left, (screenY-screenY)+top, width, height), content);
}
}
Thanks guys!
of course, if i've created my application to see the result...
Answer by MountDoomTeam · May 09, 2013 at 08:59 PM
screenX-screenX) that will always be zero, may as well write 0... or 800-800..
i think the info you need is here: http://answers.unity3d.com/questions/390912/gui-position-according-to-screen-resolution.html
http://answers.unity3d.com/questions/30146/gui-texture-scale-and-position-according-to-the-ac.html
Your answer
Follow this Question
Related Questions
how can i destroy a cube when i press a gui button??? 1 Answer
Where does GUI end up? 1 Answer
GUI in the middle of the screen 1 Answer
GUI Button in the middle of screen? 1 Answer