|
The 3D text and font systems in unity seems quite broken. How do I change the color of a font or 3D text?
(comments are locked)
|
|
This works for me:
You should see something like this in your Project panel:
With the above set up, whenever you create a 3D text, you must select the font in the Project, then Create the 3D text, then select the other font material in the new 3D text. If you don't pick them right, you just get junk text or text that is not at the right position in space. This may seem "broken", but you need to understand how fonts work in games: they are bitmaps rendered with a shader, not TTF outline path drawings. Unity allows you to just drop in a TTF and it makes the bitmaps for you, but it's not a DTP program ;-). Next, you'll want to know how to make it go behind other objects. You left out one step. You have to make sure to set the Shader of the new material to GUI/Text Shader. Put that at like step 6.5. You should see the preview change from a solid color to text wrapper around a sphere.
3 days ago
serff
(comments are locked)
|
|
Neither 3D text nor regular text are "broken". For 3D text you change the color the same way as any other object, by using renderer.material.color. If you're using text in an OnGUI function, change GUI.color.
(comments are locked)
|
|
Find your font in your project folder (inside unity), then click the little "down arrow" next to the font name. Under the font you'll see a "font material" and a "font Texture". Select the font material and in the inspector there's a Text Color field with a white rectangle next to it. Click the white rectangle and choose a new color from the color picker. All of this assumes that you've added a TTF font to your project. I don't think it's possible to change the color of the default font (Arial Rounded Bold) since it's not exposed in the project.
(comments are locked)
|
|
try something like Using Arrays like that is a strange idea...just set the values directly instead, it's much faster and easier. Also you can just use
May 04 '10 at 09:16 AM
Eric5h5
you're right, man.
May 05 '10 at 07:32 AM
headkit
(comments are locked)
|
|
I read Warwick's answer, and the thing that made it work for me, in Unity 3, is to be sure to set the Shader to be "GUI/Text Shader" rather than the default "Diffuse" when I replaced the Font material with my new, colored font material.
(comments are locked)
|
