I am creating a GUI label, and sizing it relative to the screen size like this:
Vector2 scoreTitleSizeP = new Vector2 (scoreTitleSize.x * Screen.width, scoreTitleSize.y * menuBarHeight); Vector2 scoreTitlePosP = new Vector2 (scoreTitlePos.x * Screen.width, scoreTitlePos.y * menuBarHeight); GUI.Label(new Rect(Screen.width - scoreTitleSizeP.x, scoreTitlePosP.y, scoreTitleSizeP.x, scoreTitleSizeP.y), scoreTitleText, menuStyle);
This works perfectly and it positions and scales the label correctly on different screen sizes.
However, the text inside the label doesn’t scale. I have searched intensively for the correct method of scaling the text but haven’t found (or understood) how to do this.
I know in the GUISkin I can set the font size, but this is static and doesn’t change depending on the screen size.
How can I scale the text content of the label the same way I scale the label itself? TIA!