Search Unity

[SOLVED?] Font Issues in the UnityGUI

Discussion in 'Immediate Mode GUI (IMGUI)' started by reveriejake, Oct 2, 2009.

  1. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    For some reason the whole project went haywire and I ended up having to rebuild the entire project and reconnect everything in a new folder. After I did that everything seemed to work great in the builds... I have no idea what was or is going on but it seems fixed for the time being!

    Hey I am having a bit of an issue with the fonts in my builds... Everything works great in the editor, however, when I make a build of the game I get hit and miss font.

    Start Menu Scene: First time it loads, it looks great everytime, the font is there, however when I go into the game (Scene 2) and come back to the main menu I get funky looking text EVERY TIME (see image)

    Main Game Screen: Most of the GUI works great in this scene except for when I go to the file menu and click "Quit Game" The popup menu comes up and the body text is missing and sometimes the "Accept" text is missing but the "Cancel" text is there... Then when I say cancel and try it again, all the text is there no problem...

    Here is a code snippet:

    Code (csharp):
    1.  
    2. function OnGUI () {
    3.     GUI.matrix = Matrix4x4.TRS (Vector3(0,0,0), Quaternion.identity, Vector3 (Screen.width / 1024.0, Screen.height / 768.0, 1/1));
    4.    
    5.     OpenFile();
    6.     LookingGlass(islandObject);
    7.        
    8.     if(exitGame)
    9.         ExitMenu();
    10.        
    11.     if(paused)
    12.         PauseMenu();
    13.    
    14.     GUI.DrawTexture(Rect(0,0,1024,27),topMenu,ScaleMode.ScaleToFit);
    15.     if(GUI.Button(Rect(23,-3,50,25),"File",menuStyle))
    16.     {
    17.         if(!openDrop) {
    18.             lookingGlass = false;
    19.             openDrop = true;
    20.         } else {
    21.             openDrop = false;
    22.         }
    23.     }
    24.     GUI.Label(Rect(100,0,200,25),curIslandName,menuStyle);
    25.     if(GUI.Button(Rect(310,-3,150,25),"Island Actions",menuStyle))
    26.     {
    27.         if(!lookingGlass)
    28.         {
    29.             openDrop = false;
    30.             lookingGlass = true;
    31.         }else{
    32.             lookingGlass = false;
    33.         }  
    34.     }
    35.     GUI.Label(Rect(825,0,200,25),bank.ToString(),moneyStyle);
    36. }
    37.  
    38.  
    39. function ExitMenu()
    40. {
    41.     openDrop = false;
    42.     lookingGlasee = false;
    43.    
    44.     GUI.BeginGroup(Rect(312,284,400,200));
    45.         GUI.DrawTexture(Rect(0,0,400,200),popMenu);
    46.        
    47.         GUI.Label(Rect(25,25,350,100),"Are you sure you want to exit this game?",popStyle);
    48.        
    49.         if(GUI.Button(Rect(20,135,150,50),"YES!",buttonStyle))
    50.         {
    51.             Application.LoadLevel(1);
    52.         }
    53.         if(GUI.Button(Rect(220,135,150,50),"Nope...",buttonStyle))
    54.         {
    55.             exitGame = false;
    56.         }
    57.     GUI.EndGroup();
    58. }
    I attached some images... HELP! lol
     

    Attached Files:

  2. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    35 people and no solution yet... lol

    I'm wondering if it has something to do with the way Unity builds the project, if there is something getting messed up there. If so would reinstalling Unity help? I dont know though because everything seems to work fine at one point or the other it just seems like code is getting funky in the build...

    Any help is appreciated! Thanks