I am experiencing the issue with text colour not changing to what I set in the inspector resulting in always black text.
I have followed the advise to create a material and assign that to the font and this appears to work, but only on a static text field or button text.
I have a text field in a scrollview and after I apply the material the scrollview mask no longer hides the text outside of the scroll area?
If I set the material shader to GUI/TextShader I get the correct colour, but the srollview mask does not work, if I set it to no material the mask works but colour is black?
This happens on every font as soon as I add a material?
I have tried all manner of shader setting without any joy, does anyone know how to resolve this? It seems totally bonkers to me :-(
SORTED!
I imported TextMesh Pro, used its Font Creation Tool and hey presto :-)
Not sure why the default Unity text component cant handle this?
Related
Why is the text displayed on the stage but not in the game?
To me this looks like a Canvas issue:
Make sure the canvas scale dynamically, "Scale with Screen Size"
Check Reference Resolution
Make sure the Text Anchor Preset's is correct
You should probably using "Best Fit" in the UI Text Components to make sure the text is dynamically aligned
5 - Check that your color isn't transparent.
I had the same problem seconds ago.
So the issue for me, was that my text was a component of canvas.
When I put it as an object in the scene, it rendered.
When using textmesh to add a label to my prefab gameObject in Unity, the text appears really squashed and not filling the space properly and I can't seem to figure out how to make it appear normal. I had the same issue using plain text.
Even if i make the canvas way bigger than I want it just to test, the text is all squashed and distorted
I am using a canvas and my scaling is quite small
Update:
Try to add a CanvasScaler component to your container Canvas gameObject (add it only if it is not there yet).
https://docs.unity3d.com/Manual/script-CanvasScaler.html
It has some properties but the most important is the Reference Pixels Per Unit set it to a higher, or a much higher number.
If your container Canvas has its Render Mode in Screen Space - Overlay, then your text will look little "stretched" - as your picture shows it. If you modify the scale mode to anything else, then this will be alright.
For a Unity 2D WEB GL game I'm working on I've imported and used a font which isn't one of Unity's default fonts. I use this font for the text which gets displayed on a canvas. Since my text uses some characters which aren't in the font file, I've set the font character option to dynamic. The result is that the special characters get displayed properly but the text looks quite blurry and not at all sharp.
Now what I want is the text to look sharp, but I've tried pretty much everything I could find with no success. The objects which display the text use a Text Component. I've also tried switching to a TextMeshPro Text Component and generating the font atlas and everything but again to no success.
I've also tried to set the font character type to unicode instead to see what it does (eventhough I know it will not work with my special characters). The result was quite sharper but perhaps too sharp. If I play the game not on full screen mode, some letters are so pixely/crispy they just aren't readable. Thus that wasn't an option either.
I'm at my wits end for this one. Any and all help is greatly appreciated!
Here's an image example of the blurry font:
I had the same issue with a font using textmesh pro.
Disabled the HDR of the camera component and then it was much better.
A simple solution to this problem is to play with Unity CanvasScaler component.
This is usually attached to your UI Canvas.
https://docs.unity3d.com/Manual/script-CanvasScaler.html
You can tweak the values here to get the best result.
You should increase 'Dynamic Pixels per Unit' on Canvas Scaler
I have a plane behind a text mesh 3d that i use to make the text more visible. The plane is supposed to be slitghtly transparent but when i give it a transparent shader it starts acting like the pane is in front of the text when it actually is not. How can i fix this?
Okej i solved it using a canvas, TextMeshPro- text and as background i use a UI Image. That works as i intended.
Had the same problem and found the solution:
Go on the canvas, and increase "Order in layer" until it is fixed (if it doesn't work after like 4 or 5, sry it might be something else ^^')
If it works it simply meant that the UI text was rendered before the transparent material, so you wanna tell the canvas to render itself after the material.
just like the popover in the attached screenshots, the popover allow user to change themes.
I know that there are some examples around but they are all using images to achieve this, make it hard to change themes.
I believe the app in the screenshots doesn't using images to do it.
thanks for any help!
In my Win background such skins (called "Flat" in Delphi and WinForms) were made by drawing in code: select a color, draw a line, select another color, draw a rounded rectangle and so on.
Also, it is necessary to introduce a class "ColorTheme" with a set of fields for every color used. You may have several ColorTheme instances and swap them when you need to change color theme.