Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: greyhoundgames on May 05, 2015, 11:06:53 AM
-
I had a TTF label that I made into a NGUI font label. I noticed there were some sizing problems. When i debugged into the code I saw that it was doing null checks on the ttf font which must still have been set in the serialization. Hence it got the default font size wrong. The label was experiencing some other incorrect behavior which I am hoping is related to this as well.
-
We had the same problem, just switch on Unity font, make it null(remove the ttf from the UILabel) and switch again to NGUI Font. This way it should be null.
-
I have about 2 billion labels, so hoping this can be fixed in the code :)
-
How did you happen to do that? The UILabel.bitmapFont property intentionally clears the true type font reference right after assigning the bitmap value you passed to it...
-
I had about 100 prefabs with labels that were all TTF fonts. I dropped them all in, in the filter box i typed in UILabel. Then with them all selected I clicked on the font type box and changed it to NGUI.
Then I applied all the prefabs.
How I noticed this problem in the first place is that the default font size # was showing 25 which was the UILabel.fontSize variable value instead of 64 which was the NGUI font file size.
Thats when i put a breakpoint in the UILabelInspector class and saw that the default font size getter was determining that the ttf font was not null and returning the font size itself.
-
Aren, I already told you about a similar problem on this topic:
http://www.tasharen.com/forum/index.php?topic=12501.msg57019#msg57019
-
I found the reason for this... label inspector was using Unity's serialized properties instead of actual class properties that would have set it properly.