- Home /
How do i change the fontSize of a displayed message?
Hi Community! :)
I got a message, if something happend it looks like that void OnGUI() {
var centeredStyle = GUI.skin.GetStyle("Label");
centeredStyle.alignment = TextAnchor.UpperCenter;
GUI.color = Color.black;
if (showUp)
{
GUI.Label(new Rect(Screen.width / 2 - 50, Screen.height / 2 - 25, 100, 50), "blaaaaaaaaaa", centeredStyle);
}
}
But the fontsize is small... can i make it bigger ? but no fix size - just bigger - maybe in relation to the screensize?
Thx!
Comment
Answer by Flaring-Afro · May 05, 2016 at 12:07 PM
Use the Canvas Scaler to have your UI adjust with screen size.
But i have no Canvas Scaler in my Inspector
The displayed message is just short timed for choosing another pawn in the game ;)