Changing size of button text?!

Hey,

Im using GUILayout.Button to draw buttons for a menu, its working really well however i need to change the default text size.

function PauseMenu() {

style = new GUIStyle();
style.fontSize = 50;

if (GUILayout.Button ("Exit", style)) {
		 Application.Quit();
	}

}

As above i have tried using styles however this doesn’t work. Can anyone please help me?

Thanks for the help

Use a GUI Skin. Create one and this to your code :

var newSkin : GUISkin;

function OnGUI() {

 GUI.skin = newSkin


 

if(GUI.Button(Rect(Screen.width /2 - 100,Screen.height /2 - 90,250,50), "Quit")){

         Application.Quit();

    }

 

}

Tweak the Font Size under Button Settings in your new GUI Skin and then Attach your new GUI Skin to this script in the inspector