- Home /
How to change font color
Well I've been looking in answers and on Google and nothing I've found has worked for me for some reason
When I import a ttf font, the option to change the color is ghosted and I've tried creating a material and making it a GUI/Text Shader but it won't let me apply it to the font
Can anyone give me specific info on how to do this?
Answer by FLASHDENMARK · Mar 04, 2011 at 06:54 AM
You cound use scripts to change the color of you fonts:
// Red color:
renderer.material.color = Color.red;
//Yellow color:
renderer.material.color = Color.yellow;
// Blue color:
renderer.material.color = Color.blue;
// Green color:
renderer.material.color = Color.green;
// Black color:
renderer.material.color = Color.black;
// Grey color:
renderer.material.color = Color.grey;
Answer by koboldskeep · Nov 11, 2013 at 01:49 AM
I found that using rich text color tags worked much better. Much easier than fiddling with the font materials.
http://docs.unity3d.com/Documentation/Manual/StyledText.html
Answer by yoyo · Mar 04, 2011 at 05:15 AM
One method for colouring text is to set GUI.contentColor in your OnGUI method before you render the text. This method allows you to import a white font and use it for many different text colours.
Answer by pamelacook · Apr 22, 2018 at 03:48 PM
I assign my fonts a UI/Default Font material to globally change the font color. Works well.