How can i make it appears in my gui?

Heres my script :

var ItemIcon : Texture2D;

function OnGUI ()
{  
  GUI.Button(Rect(599,530,60,54),"3"), ItemIcon);
}

How do i make it when GetMouseButtonDown(1) it added in to my gui button?
Like an item added into the GUI.
Will someone help me?

Do you mean, you want to make the GUI texture appear when the button is pressed?

I don't understand what you want...

1 Answer

1

you could use some code like this

var firstpressed: bool = false;

OnGUI…

if(GUI.Button(Rect(599,530,60,54),"3"))
{
    firstpressed = true;
}
if(firstpressed)
{
    GUI.label(rect(599,600,60,54),"The '3' button was pressed");
}

Remember to mark the answer as correct.