I have recently upgraded my Unity from 3.5.0 to 4.1.2, after upgraded my project, I run it and found that all GUI fonts disappeared. They are coded in this way:
void OnGUI() {
Rect rect;
int num;
GUIStyle style;
GUI.Label(rect, num, style);
}
How to fix this? Thanks.
maybe you need to re-assign the font in the inspector?
– IronFurballI tried but no luck. I noticed that font will appear if I use "None" for Font, but see nothing when I use custom font. My font can be used in Unity 3.5
– fanling3when using a custom font maybe you also need to set the font size a little higher, like to 16-18? Also, make sure your rectangle appears on screen, if you have negative values in your rect there's a big chance its simply to small or off screen.
– IronFurballActually, your code doesn't make any sence to me at all :S I think how one would usually tpye it is like this: Rect myRect = new Rect(0,0,200,200); GUIStyle myStyle; //now you can assign all the GUIStyle properties in the inspector. void OnGUI() { GUI.Label(myRect,"hi",myStyle); }
– IronFurballJust to tell you what function I used for diplaying the GUI, it's an existing project running in Unity 3.5
– fanling3