- Home /
Question by
CornDog3241 · May 29, 2012 at 12:22 AM ·
guibuttons
GUI Display Help
Hey everyone, I'm currently working on a game for a class I have and I need just a little bit of help.
This is what the code looks like...
var Cactus : Texture2D; var Cactus2 : Texture2D; var button1clicked=false;
function OnGUI () { if (GUI.Button (Rect (375, 100, 150, 100), Cactus)) { if(!button1clicked) button1clicked=true; else button1clicked=false; }
if(button1clicked){
GUI.Box(Rect(375, 210, 315, 300), "");
GUI.Label(Rect(375, 210, 90, 90),"Cactus");
GUI.Box(Rect(10, 370, 350, 140), Cactus2);
}
}
What I want to happen is when I click another button, the previous button is deactivated.
Does anyone know what the code would look like? All the help would be greatly appreciated! :D
Comment
Did you not already ask and get an answer to this question here:
http://answers.unity3d.com/questions/258987/gui-display.html