x


How do I change the font size...

Hi. No matter what I do the GUI Skin, I cannot change the size of the font. I have tried changing fonts and even removing the GUI skin...nothing, the font always stays the same size (and yes, I am changing the number in the "Label" section of the skin editor). What am I doing wrong?

var Score : float;
var myGUI : GUISkin;

function OnGUI (){
    GUI.skin = myGUI;
    GUI.Label (Rect (Screen.width/2+(Screen.height/2.17),Screen.height/21.3, Screen.height/02.5, Screen.height/8),Score.ToString("000000"));
}
more ▼

asked Sep 11 '12 at 02:52 PM

Tofudude624 gravatar image

Tofudude624
165 28 69 94

Are you coding for a mobile platform?

Sep 11 '12 at 03:46 PM whydoidoit

Yes I am (iOS).

Sep 11 '12 at 09:15 PM Tofudude624
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

On iOS you need to import the font resources at all of the different sizes that you want in Unity 3 (Unity 4 removes this limitation).

more ▼

answered Sep 11 '12 at 09:38 PM

whydoidoit gravatar image

whydoidoit
33k 11 23 100

Can I change the font size based on the device's screen resolution? As of now (I have not tried your answer yet because I am away from my computer), the text is the correct size (relative to the rest of the screen) on non retina displays only.

Sep 11 '12 at 10:40 PM Tofudude624

I've been searching for how to do this, in Unity 4, and seeing lots of answers like this one ("Unity 4 removes this limitation"), but none explaining HOW it does so... do I just set the font size, and it actually works in Unity 4?

Apr 05 at 03:17 AM JoeStrout
(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:

x3681

asked: Sep 11 '12 at 02:52 PM

Seen: 245 times

Last Updated: Apr 05 at 03:17 AM