- Home /
New UI Text is blurier than GUIText
Hi all,
I am converting my game menus into the new UI tools with 4.6 but the text object seems to make text that is much blurier than the old GUIText, as you can see here.
GUIText is above, Text is below
The canvas scalar is set to Scale with screen size, dont know if that affects it at all though. Does anyone know how to fix this?
You could scale down your UI Text (using the scale property, not using the rect tool) and increase font size.
That seemed to do the trick, do you have any idea why that works though? seems weird that the new system has a lower fidelity component like this.
Text is displayed as a texture. The individual letters get rendered to an image, which is probably filtered (antialiasing). I guess the text gets rendered smaller in the new system while it is scaled up in the component again to get the same visual size again. Seems like a design decision to me. I haven't had any problems with blurry UI Text, at least not on mobile.
I'll answer the question (even if it's >2 years old) about why scaling the UI (in the 4.6+ UI) is necessary since this page come up on top of Google Search. It's because of how UI and fonts are managed from a referential state. To put it simple, UI and fonts are registered in the engine with different kinds of units than generic units. The UI (texture) are calculated in pixels and fonts are calculated in Points (an actual measure like meters and inches). As the new UI is instance based and calculated within Unity 3D (transform) language, those 2 forms of values aren't existing so, ins$$anonymous$$d, they are interpreted as generic units.
This means that if, in your game, 1 unit is equivalent to 1 meter (in the scene), then 1 pixel on the UI is also interpreted as 1 meter. This is why you got a huge planar view of the UI in the Scene windows that far exceed the scene content.
This is also why whenever you use the 3D UI system (Canvas set in World Space) you will have to set the scale the canvas something like 0.005 or even less. (Let's say you have a canvas of 1024x1024 in WorldSpace. That means it's 1024x1024 units big... or 1024m width by 1024m height. Way too big for the camera view. 0.005 scaling it turn it to 5.12mx5.12m, meaning each "pixel" in the UI is around 0.5cm in the scene.)
Fonts' points system is relatively similar where 1 point is really close to 1 pixel when on a common PC screen. (Where this is not true is when the screen display higher than 72 pixel per inches like cellphone which has usually 125 ppi now. On such cellphones' screen, 1 point for fonts = 1.7361 pixels) Anyway. That's a general idea why the 4.6+ UI in Unity requires this kind of interpretation. It's not an issue from within Unity, but more about how each of those 2 parts of the feature are natively managing from their raw data.
As specified by others, the UI 4.6+ is basically planes automatically generated with textures made from fonts for each characters. In terms of rendering, it's requires a bit more resources on the base to run it, but when you got many things in the UI managed at once, it becomes more economic in the long run (and easier to handle) as the system has an integrated Transform and Positioning system that works for all related UI (which allow many things with the UI without any addition to the memory consumption.)
Answer by KEELAN · Dec 16, 2014 at 10:30 PM
Answer from SimonTS:
You could scale down your UI Text (using the scale property, not using the rect tool) and increase font size.
This works great. Attaching a picture for further explanation. $$anonymous$$y original font for the buttons was 14. To scale it up and fit, I multiplied the text size by 5 (14 x 5 = 70) and scaled down the Rect Transform by 1/5 (.2). Now, it scales and isn't blurry.
Note that I had to set the text to Overflow for this to work.
@jmasinteATI Great technique bro I am using your said technique from now onwards but can you please tell me why you scaled in the z axis also... because it seems to work perfectly fine without scaling in z axis?
It's just me being OCD with proportions. I can't find any info on UI z scale. Even when I set it to zero it still shows up so maybe it isn't used.
Answer by U_Ku_Shu · Aug 08, 2016 at 11:20 AM
Few solutions of the same problem:
http://answers.unity3d.com/questions/1226551/ui-text-is-blurred-unity-535f.html