Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: beermoney on March 04, 2014, 05:18:33 AM
-
Morning,
This is a suggestion I think may benefit lots of people. I'd like to treat fonts with some indirection, that is in my UI I have hundreds of labels and the all reference their fonts explicitly. If I want to change the font every where then it's very time consuming. (I'm currently writing scripts that do something like foreach (label in scene) {if label.font==fontX then label.font=fontY})
A better system would be to use a font reference (similar to an atlas reference), this way I can setup my UI and using something like "HeaderStyleFont" which points to an actual font. Should I then want to globally change the font I need only change the reference font instead of the every label going.
If this is already possibly within NGUI then I like to know how!
Thanks
-
Look into the "Reference font" feature in NGUI. This is exactly what it's designed to do. It's exactly the same as reference atlases.
1. Create a game object.
2. Add UIFont to it, set it to "Reference", make it point to an actual font.
3. Save as a prefab.
4. Use this prefab on all of your labels.