Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: shokinhan on August 21, 2012, 08:04:30 AM

Title: About font fuzzy
Post by: shokinhan on August 21, 2012, 08:04:30 AM
Some times the label's font are very clear, but some times the fonts are fuzzy!   Why?


Title: Re: About font fuzzy
Post by: PhilipC on August 21, 2012, 09:23:00 AM
It would be due to them not being pixel perfect. Try hitting Alt-Shift-P
Title: Re: About font fuzzy
Post by: shokinhan on August 22, 2012, 03:17:38 AM
The code:   
                        newObj.GetComponentInChildren<UILabel>().text = text;
         newObj.GetComponentInChildren<UILabel>().MakePixelPerfect();

So i have done!

Title: Re: About font fuzzy
Post by: shokinhan on August 22, 2012, 03:18:24 AM
The code:   
                        newObj.GetComponentInChildren<UILabel>().text = text;
         newObj.GetComponentInChildren<UILabel>().MakePixelPerfect();

So i have done!

But the font are fuzzy some times also.
Title: Re: About font fuzzy
Post by: Nicki on August 22, 2012, 05:19:09 AM
Make absolutely sure there's not an object higher in the hierarchy that has it's position in an "off float" like 0.23 or whatever. Every transform all the way down to your labels should be integers.
Title: Re: About font fuzzy
Post by: shokinhan on August 22, 2012, 07:52:05 AM
 There's not an object higher in the hierarchy ? Does your means no another object's z or depth is higher than label font? 
Title: Re: About font fuzzy
Post by: PhilipC on August 22, 2012, 10:23:45 AM
You dont have any other objects higher in the hierarchy? That seems a little wrong. Can you show us an image of your hierarchy view?

Also please try Alt-Shift-P in the editor i know you have code running to "make pixel perfect" but try the short cut.
Title: Re: About font fuzzy
Post by: shokinhan on August 22, 2012, 11:11:59 PM

The objects "Desc" ,"Level" and "Title" are text, "Icon" and "UIToolBG" are picture sprite.

This is a tooltip's hierarchy. Thanks!
Title: Re: About font fuzzy
Post by: ArenMook on August 22, 2012, 11:25:15 PM
Per-pixel labels will only happen if all of these conditions are met:
Title: Re: About font fuzzy
Post by: shokinhan on August 23, 2012, 01:30:32 AM
I do the tooltip, so the tooltip can be moved around the cursor, so the tootip will happen per-pixel, but how to resolve this problem ?

Thanks!


Title: Re: About font fuzzy
Post by: ArenMook on August 23, 2012, 02:03:56 AM
I'm not sure I understand what you're asking. The tooltip should already be pixel-perfect, assuming you followed the same structure as in the Character example.
Title: Re: About font fuzzy
Post by: shokinhan on August 24, 2012, 05:15:14 AM
If i have drag the uilabel, should i invoke the function MakePixelPerfect() ?

Title: Re: About font fuzzy
Post by: ArenMook on August 24, 2012, 05:20:18 AM
Sure, that would help. However I suggest dragging the panel, not the label. Also when you drag the panel you can just Mathf.RoundToInt() on the XY components instead of calling makepixelperfect.