- Home /
change font size help - impossible?
i need to change the font size for my script. i have tried doing this (shown in my script) but it has no affect on it. how can i increase the text size without using dynamic fonts
var hasCollided : boolean = false;
var labelText : String = "";
function OnGUI()
{
if (hasCollided ==true)
{
GUI.Label(Rect(140,Screen.height-50,Screen.width-300,120),(labelText));
GUI.Label.fontSize = 50;
}
}
function OnTriggerEnter(c:Collider)
{
if(c.gameObject.tag =="Player")
{
hasCollided = true;
boxText = "DOOR LOCKED";
}
}
function OnTriggerExit( other : Collider ){
hasCollided = false;
}
thanks
Answer by OrbitGames · Sep 09, 2014 at 02:45 PM
first, try putting it before the label(not sure if that will fix it)
if not you will have to use a guiskin(documentation, manual)
first create a public GUISkin guiSkin;
guiSkin.label.fontSize = 50;
GUI.skin = guiSkin;
(untested)
by the way, for bools you don't have to write if (hascollided == true), if (hascollided) is enough, and if (!hascollided) is the opposite
are you sure you typed it like this:
public GUISkin guiSkin;
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
this is part of my health script it gives me a error unknown identifier GameScore pls help thxxx 0 Answers
Targetting error please help 0 Answers
Monodevelopement not responding? 2 Answers
Please help, trivia scripting 2 Answers