- Home /
adding material to unity guitext makes font turn into blocks
Hi - I'm trying to simply make my font a different color, and apparently the only way to do that is add a material to it, but when I do so, the entire font turns into a bunch of square blocks. Is there a fix for this? Is there a better way to get a colored font in Unity?
Answer by Eric5h5 · Jul 28, 2011 at 08:31 PM
You need to use the correct font in the GUIText as well as the material, and the material needs the correct font texture.
Right. So I followed the instructions in Unity, and created a new material. In that material I created a shader called GUI / Text Shader. I set the color. There's a spot for a texture and the instructions say to set the texture to that of your font, but I don't understand that. $$anonymous$$y font doesn't have a texture. It's just an imported TTF font. How do I assign the material a "font texture"? I see that if I import a font it creates a font texture, but then it gives me an error "font size and style overrides are only supported for dynamic fonts" - and it also does not let me use the color picker to pick a color. So I'm trying to just use the default (Arial).
You can't use a dynamic font, since it doesn't generate a texture (except dynamically at runtime, which isn't helpful in this case).
Ugh. Why is this so hard. I just want to change my font color. I'm more confused than ever now on how to do it.
Fonts don't generate a texture unless they are set to non-dynamic. Then you can get the texture from them. Also, http://www.unifycommunity.com/wiki/index.php?title=SaveFontTexture
Your answer
Follow this Question
Related Questions
Simple menu problem 2 Answers
Change color of 3D text or font 6 Answers
How to find a font via script? 2 Answers
Getting pixel perfect text with either text meshes or GUI Text on a worldspace canvas 0 Answers
Text Changes to Black 7 Answers