Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started 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?
-
It would be due to them not being pixel perfect. Try hitting Alt-Shift-P
-
The code:
newObj.GetComponentInChildren<UILabel>().text = text;
newObj.GetComponentInChildren<UILabel>().MakePixelPerfect();
So i have done!
-
The code:
newObj.GetComponentInChildren<UILabel>().text = text;
newObj.GetComponentInChildren<UILabel>().MakePixelPerfect();
So i have done!
But the font are fuzzy some times also.
-
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.
-
There's not an object higher in the hierarchy ? Does your means no another object's z or depth is higher than label font?
-
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.
-
The objects "Desc" ,"Level" and "Title" are text, "Icon" and "UIToolBG" are picture sprite.
This is a tooltip's hierarchy. Thanks!
-
Per-pixel labels will only happen if all of these conditions are met:
- Your UI is 2D.
- You are using UIAnchor with "half-pixel offset" checked.
- Scales of all objects leading up to your labels are (1, 1, 1), excluding UIRoot.
- Positions of all objects leading up to your labels use integer numbers: ie (1, 2, 3) instead of (1.23, 2.34, 3.45).
- None of the objects leading up to your labels have been rotated.
- Your actual label is pixel-perfect (Make Pixel Perfect button).
-
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!
-
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.
-
If i have drag the uilabel, should i invoke the function MakePixelPerfect() ?
-
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.