How would you shrink and enlarge text in realtime called by the OnGUI function?
Ex.
function OnGUI(){
GUI.Label(Rect (Screen.width/HorizontalPosition,Screen.height/verticalPosition,Screen.width, Screen.height), "text");
}
How would you shrink and enlarge text in realtime called by the OnGUI function?
Ex.
function OnGUI(){
GUI.Label(Rect (Screen.width/HorizontalPosition,Screen.height/verticalPosition,Screen.width, Screen.height), "text");
}
Not like that. You must either use a GUIText, change the GUI matrix, or modify GUI.skin.label.fontSize. Note that regardless of technique, you may not get adequate performance if you ask for font characters in many different sizes, and you will possibly waste memory, since each needs to be rendered by the dynamic font. If you only need to do this with one string (eg. game title), then youll get best results by creating a mesh of the vector form of the text in your modeling software - that is small and completely scalable. Of you need it for many texts, then pick one large size for the characters and use the matrix to texture-scale it - that will not be hi-rez, but will perform well.