- Home /
Question by
iamthecoolguy11 · Aug 19, 2014 at 09:36 PM ·
c#guiscalestring
How do I change the fount size of GUI
I looked around on the net and I haven't found much that works with a string in the GUI text this is one of the things I have tried.
public string names = "Press F to toggle the sink";
void OnGUI()
{
if(on == true)
{
GUI.Label(new Rect((Screen.width / 2) - 0, (Screen.height / 2) + 0, 200, 200), names, guiText.fontSize = 50);
}
}
Comment
Best Answer
Answer by SolutionStudios · Aug 19, 2014 at 10:09 PM
Try using GUIStyle.fontSize
http://docs.unity3d.com/ScriptReference/GUIStyle-fontSize.html
public string names = "Press F to toggle the sink";
void OnGUI()
{
if (on == true) {
GUIStyle myStyle = new GUIStyle();
myStyle.fontSize = 10; //change to font size
GUI.Label(new Rect((Screen.width / 2) - 0, (Screen.height / 2) + 0, 200, 200), names, myStyle);
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613161021im_/https://answers.unity.com/themes/thub/images/avi.jpg)