Search Unity

GUI.Buttons not showing

Discussion in 'Immediate Mode GUI (IMGUI)' started by yellowlabrador, Dec 22, 2007.

  1. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Hello All,

    Happy Holidays :D

    I have a OnGUI script that will slide up and down the gui box.
    I can't figure out why the other buttons does not show when the functions get called. the script is below.

    Thanks for any help I can get.

    Ray

    Code (csharp):
    1.  
    2. GUI.BeginGroup(Rect(Screen.width/2-256,Screen.height/2-256,512,mainMenuGUIGroupyShow));// change y pos. to lower # to slide up
    3.     GUI.skin = mySkin2;
    4.    
    5.     GUI.Box (Rect(1,0,512,512),"");
    6.     GUI.skin = mySkinMainMenuButtons;
    7.        
    8. /*******This shows at start of screen *********/       
    9.         if(gamesButtonGUIGroup == false)
    10.         {
    11.            
    12.             if(GUI.Button(Rect(192,128,128,64),"GAMES"))
    13.             {
    14.                 SlowMoveMainMenuGUIHide();
    15.                                                    
    16.             }  
    17.             if(GUI.Button(Rect(192,256,128,64),"CREDITS"))
    18.             {
    19.                 creditsButtonGUIGroup = true;
    20.             }
    21.    
    22.             if(GUI.Button(Rect(192,384,128,64),"EXIT"))
    23.             {
    24.                 Application.Quit();
    25.             }
    26.        
    27.         }  
    28.    
    29. /**********This part the print / Debug.log gets called, show's in console but the buttons don't change, still showing the first 3 buttons*/
    30. //GAMES BUTTONS
    31. if(mainMenuHidden == true  mainMenuGUIGroupyShow == 128)
    32.     {
    33.         SlowMoveMainMenuGUIShow(); //Slide the GUI back down
    34.                                
    35.         print("I GOT CALLED");
    36.                
    37.         GUI.Button(Rect(100,200,128,64),"CAPITALS");
    38.         GUI.Button(Rect(300,200,128,64),"FLAGS");
    39.         GUI.Button(Rect(300,280,128,64),"LOCATIONS");
    40.         GUI.Button(Rect(100,280,128,64),"BORDERS");
    41.                
    42.         Debug.Log("BUTTONS SHOULD SHOW");
    43.      }
    44.  
    The GUI slides up and down properly. Calling a co routine. I also tried putting the conditions in an update function but still same issue.

    What I'm trying to do is I have a main GUI group with a banner that when a player clicks a button the bottom part slides up then when it slides down a new set of button appears.

    Thanks again very much,

    Ray