- Home /
Problem Trying To Get GUI.Label Centred
Hello,
I'm trying to get this GUI.Label bang in the middle of my screen but I keep running into problems. I am using a custom GUI with a font size of 200 and the alignment of UpperLeft.
GUI.skin = customSkin;
GUI.Label(Rect((Screen.width/2) - (150/2), (Screen.height/2) - (150/2), 150, 150),""+countDown,"CountDown");
GUI.skin = null;
I keep messing around with the settings, trying to adjust it - and it keeps moving from one side to another. All my other labels are fine, it only seems to be this one because the font is massive.
What am I doing wrong?
Thanks
Answer by Bunny83 · May 24, 2011 at 12:40 PM
I don't get why you use the alignment UpperLeft when you want to have it centered... How about using TextAnchor.MiddleCenter?
I have tried using alignment of UpperCenter and it moves all the way across to the other side of the screen and down a few pixels
That sounds really strange... Do you use any groups in your GUI code?
Your answer
Follow this Question
Related Questions
How Do I Center A GUI Label? 5 Answers
Possible to change GUI.Label fontsize without using GUIStyle? 1 Answer
Changing a GUILabel text SIZE 3 Answers
Why do a GUI.label and GUI.textfield not align vertically? 1 Answer
Fix Resizing For GUI Label? 1 Answer