- Home /
How to display a set of guiText OnGUI
var previousWord : Array = new Array();
Hi, I will have an array of guiText. What i would like to do is to display it. How can i do about it.
function completeLevel()
{
if(level1)
{
for (var j : int=0; j < previousWord1.length; j++)
{
word.guiText.text += gameControl.previousWord1[j].ToString() + "\n";
GUI.Label(Rect(30, 20, 160, 120), "what should i put here? ");
}
}
// You may put a button to close the pop up too
if (GUI.Button(Rect(30, 150, 75, 30), "OK"))
{
level1 =false;
} }
Comment
A GUIText object is a component that displays text on the screen. It has nothing to do with the 'GUI.whatever' commands used inside of OnGUI. It is part of the old GUI system that existed before the OnGUI stuff was added.