help with gui

hello!

i’ll make game for iphone/android.
i dont know how to setup gui, with function OnGUI() or just setup as gameobject.
which is better?
If i setup them with onGUI() the rect will be the same on any device, so i dont need to size guis on different resolutions, am i right??

sorry for bad eng :wink:

onGUI() is code so if you change the position or size is better then just setup as gameobject.

i recommend using OnGUI() from code… because you can do something like this:

(GUI.Label(Rect(Screen.width /2 - 100,Screen.height /2 - 100,250,50), "Hello World!"))

that will make your GUI Label appear in the very center of any screen. If you change the screen ratio, then the text will move to the center…

Hope this has helped a bit!!! :smiley:

-Grady