Simplest way to make a textbox?

Hullo GUIers,

Bear in mind that I’m horribly inexperienced when it comes to Unity’s GUI functions. Right now, I have a little ability selection bar where you pick various abilities and I want a short explanation of each ability to appear when you click on it. Basically, I want to be able to make a box that is filled with text and auto-formats itself (including line jumps), and I want to be able to place it at certain coords on the screen.

Was looking at things like GUILayout and it’s various functions, but I can’t seem to find a simple explanation on what I should do here. I know there should be a way I can define a rectangle (say 300 by 300, for example) then insert a string into it. When the string is longer than 300, it skips a line and continues. Also, is there any way in a string to force a line skip? I vaguely remember that it was something like \n in python, but it doesn’t seem to work here…

Thanks for any help!

GUILabel in combination with a GUIStyle for formatting sounds like what you’re looking for.

If you’re struggling with the GUI concepts, there’s a great video from Unity 2.0’s Unite conference where they go over the GUI in detail.

http://unity3d.com/support/resources/unite-presentations/in-game-gui-made-easy

Aight, guess I’ll peruse the various GUI tutorials, and read the PDF from the Unite conference. I s’pose I’d have to learn the GUI tools sooner or later, but looking at some of the functions, I can’t help but imagine a wonderful drag and drop GUI tool…thanks for the help!

I know this post is very old, but if you’re still struggling, I have a couple suggestions.

5392344--546861--mightymouse.gif

1 Like