I’m loading the font like this:
Font fontNormal;
GUIStyle gsNormal;
void Start()
{
fontNormal = Resources.Load("FontNameOfSomeKind", typeof(Font)) as Font;
fontNormal.material.color = new Color(1f,1f,1f); // this does nothing?
gsNormal = new GUIStyle();
gsNormal.font = fontNormal; // same with default Arial font...
gsNormal.fontSize = 50;
gsNormal.alignment = TextAnchor.MiddleCenter;
gsNormal.fontStyle = FontStyle.Normal;
}
Nothing, the text is black. Not white or any other color.
I dont use GUI Text as component, but the GUI.Box like this:
void OnGUI()
{
float width = Screen.width;
float height = Screen.height;
Rect textline = new Rect( width/2-400, 20, 800,50);
GUI.Box(textline, "here is my WHITE text - I thought?",gsNormal);
}
I think that by default new GUIStyles have all their text colours set to (0, 0, 0, 0)! You have to manually set the GUIStyle color as well as just the font color.
– syclamoththanks mate, but I posted the answer already. I was addressing the wrong variable/attribute. :o)
– BerggreenDK