- Home /
Get GUI Text Object to appear in the top left corner of the screen.
How can i keep the GUI Text component of a GameObject in the top-left corner of the screen? And no, I do not want to use GUI.Label (unless you can show me how to use a different font and material for it, i haven't been able to find this in the scripting reference at all,). So, some pointers on how to do this will be much appreciated.
I started out not knowing scripting or coding at all a few months ago, and this type of question is one of the easiest to just find in the documentation, or through google. This place takes up peoples' time, I think more people should respect that. There's a chance it will get too cluttered and people won't bother going here and answering people's questions anymore. You got 71 questions in your history, most of them very basic.
Don't take offense, try to find out for yourself first that's all I am saying!
Don't take offense = You're gonna offend me. Well done. I have tried looking, and i have not found anything. I know, it's a simple question, which is why i just need a simple answer. I have explained as much as i can and no one has answered.
Answer by Molix · Mar 03, 2011 at 06:01 AM
After using GameObject > Create Other > GUI Text, change the object's Transform position to (0, 1, 0). The text will be in the upper left corner and stay there through resizing, etc.
Answer by GameGuy · Oct 22, 2010 at 02:30 PM
function OnGUI () {
GUI.Box (Rect (0,0,100,50), "Top-left");
}
Try the Gui-Basics in the Manual http://unity3d.com/support/documentation/Components/gui-Basics.html
This hasn't moved my GUIText GameObject to the corner of the screen at all, just drawn a box there. You know, as in one of the guitext objects you make form GameObject > Create Other > GUI Text?
Youre right, this code is for a button! I use it with Gui.Label and it works for me, and of course you can change the font of the Gui.Label check out Assets>Create>GuiSkin
Answer by Waz · Jun 27, 2011 at 05:04 AM
To change the font of a GUI.Label, all you do is modify the GUI.skin you are using, either by changing the Label style in it, or by adding a custom style, then using that for your label.