Buttons

From ETC Public Wiki
Jump to: navigation, search

Making Buttons

 function OnGUI() {
   var buttonW : int  = 150;
   var buttonH : int  = 50;
 
   GUI.BeginGroup(Rect(1100, 0, 400, 768));
 	
   // state buttons
   if (GUI.Button(Rect(25,40,buttonW,buttonH), "Start")) {
       print ("state = Start");
 	SetState("Start");
   }
   if (GUI.Button(Rect(200,40,buttonW,buttonH), "End")) {
       print ("state = End");
       SetState("End");
   }
 
   GUI.EndGroup();
 }