Search Unity

Changing Text Size

Discussion in 'Immediate Mode GUI (IMGUI)' started by terransage, Nov 23, 2007.

  1. terransage

    terransage

    Joined:
    Jul 17, 2006
    Posts:
    290
    Hi, all!

    Last night was the first time I really had a chance to explore UnityGUI, and I was wondering if there's a way to change text size, using GUIStyle or GUILayout or any other method? I suppose it could be done by changing the font preferences, but I wondered if there's another way? (I'm away from my home computer right now, so I can't give details of what I did. All I know is that I tried to make changes in the Custom Box field in the Inspector, to no avail.) I also searched the forums, but didn't find the answer. Thanks in advance for your help!
     
  2. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    If you want to change the text size then you'll need to import multiple font assets, each one at a unique point size (10, 12, 16, etc.). Then when you want to change the font size at run-time you can either modify your GUISkin or apply a new GUIStyle as needed.
     
  3. terransage

    terransage

    Joined:
    Jul 17, 2006
    Posts:
    290
    Thanks, Tom. I figured the secret was the font size itself, but I wasn't sure.