x


Change GUI Font Size Dynamically?

Hello,

I have a GUI label in my OnGUI function, and I want to be able to increase the size of the font within my script. Like so:

var fontSize : int = 20;

function OnGUI(){

   GUI.Label(100,30,0,0),"WAVE ONE!", ?fontSize?);
   fontSize++;

}

Thus causing the font size to grow over fps... How would I achieve something like this?

more ▼

asked Feb 19 '12 at 07:04 AM

oliver-jones gravatar image

oliver-jones
2.5k 207 226 257

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

GUIStyle.fontSize, only for dynamic fonts. (You can't use fontSize++ in OnGUI like that, though, it will be framerate-dependent.)

more ▼

answered Feb 19 '12 at 08:56 AM

Eric5h5 gravatar image

Eric5h5
81.5k 42 133 529

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3811
x295
x250
x47

asked: Feb 19 '12 at 07:04 AM

Seen: 1514 times

Last Updated: Feb 19 '12 at 08:56 AM