Change the text's size in a GUI.Label and GUI.TextField

Hi,

I want to know if it’s possible to change the size of a text in a Gui.Label or Gui.TextField?

thanks in advance

Then you must set a GUI style, and in that set a font with the size you want.

try this Unity - Manual: Customization

ok thanks for your answer
i think i’ve understand what you mean
but now can you tell me how can i create a new “font”?

You will need to import a true type font (.ttf) as Asset before you can create new ones. By duplicating it, and importing each copy with different settings, you can create fonts of different sizes.

However, if you don’t really care if your text and it’s background isn’t pixel perfect, you could consider using GUIUtility.ScaleAroundPivot(…). This function will scale any GUI elements following it. It is a bit of an advanced feature, though (the manual even warns against using GUIUtility functions :P).

Creating multiple fonts will definately be easier.

thanks for your help Tom :smile: