Searching, and searching and searching. Ive read a few dozen answers now, digged through the manual, but i still dont get it. How do i colour this GUI.Label text, to let`s say give it a black colour? And how do i change the font for it? I simply miss the concept here.
function OnGUI () {
GUI.Label (Rect(32, 100, 200, 400), "I need black, not white \nand another font wouldn`t hurt neither");
}
Could somebody be so kind and provide an example please?
function OnGUI () {
GUI.contentColor = Color.black;
GUI.Label (Rect(32, 100, 200, 400), "I need black, not white \nand another font wouldn`t hurt neither");
}
Use a new GUISkin or GUIStyle with a different font. You can also specify the color in the style or skin instead of code.
If you expose a Guistyle reference in the inspector you can change it’s elements and then reference them in code. You can use this to change font, alignment, color, background images or anything else.
There’s an example of it in the following thread.