Answer by Jesus_Freak
hey there again! here's the code to do that: var windowWidth : int = 200; var windowHeight : int = 200; /*var here from your other script should be Str. doesn't have to be in this script though. that's...
View ArticleAnswer by Eric5h5
You need a GUIStyle that has a centered alignment. You can do this programmatically by getting an existing style and setting the alignment:function OnGUI () { var centeredStyle =...
View ArticleAnswer by langalang
Another way is to set the alignment to "Upper Center" in the GUIStyle. Set your label to be anchored to the x=0 and height you want, then make sure your label width is set to the screen width. Eg...
View ArticleAnswer by squishy312
This seems to work for me in C#, should be similar in Javascript. :) GUI.Box (new Rect ((Screen.width)/2 -(Screen.width)/8,(Screen.height)/2-(Screen.height)/8,(Screen.width)/4,(Screen.height)/4),...
View ArticleAnswer by Jesus_Freak
hey there again! here's the code to do that: var windowWidth : int = 200; var windowHeight : int = 200; /*var here from your other script should be Str. doesn't have to be in this script though. that's...
View ArticleAnswer by Eric5h5
You need a GUIStyle that has a centered alignment. You can do this programmatically by getting an existing style and setting the alignment:function OnGUI () { var centeredStyle =...
View ArticleAnswer by langalang
Another way is to set the alignment to "Upper Center" in the GUIStyle. Set your label to be anchored to the x=0 and height you want, then make sure your label width is set to the screen width. Eg...
View ArticleAnswer by squishy312
This seems to work for me in C#, should be similar in Javascript. :) GUI.Box (new Rect ((Screen.width)/2 -(Screen.width)/8,(Screen.height)/2-(Screen.height)/8,(Screen.width)/4,(Screen.height)/4),...
View ArticleAnswer by shikekaka
Thanks, everyone! I spent half a day on this, and I realize it was because of the ** Rect** not centering, not because of the **GUI Label**. ---------- A quick fix would be to move the starting point...
View Article