- Home /
Move the text in a GUI Button/Box
When you put text (content) into a GUI box or button, the text always appears at the top in the center. How do I alter my code to make the text appear lower down?
GUI.Box(new Rect(400,150,500,300), "Level Complete!");
Do I put it somewhere after the string ""? Thanks
Answer by AlucardJay · Apr 19, 2013 at 07:56 PM
Set the coordinates in the Rect( startX, startY, widthX, heightY )
Can you give me an example of this please. (Into my example).Thanks
The Unity Documentation and Unity Scripting Reference links I provided have the examples. Do you understand what a Rect is, and what it means in the GUI command?
Rect( startX, startY, widthX, heightY )
// Rectangle( start position X, start position Y, width along X, height along Y )
GUI.Box(new Rect(400,150,500,300), "Level Complete!");
GUI.Box(new Rect(10,10,150,35), "Level Complete!");
You should really take a look at : http://docs.unity3d.com/Documentation/Components/gui-Basics.html
You probably want GUI.Label ins$$anonymous$$d of GUI.Box
Your answer
Follow this Question
Related Questions
Gui Text Script 4 Answers
Changing 3d text through script 1 Answer
Playing multiple sounds with multiple subtitles 1 Answer
GUIText Problem With MENU 1 Answer
GUI Text from script Java 1 Answer