- Home /
How can i change the color of GUILayout elements? such as buttons
I tried GUI.Color but it doesnt work
Answer by RobAnthem · Dec 29, 2016 at 08:15 PM
Umm, you simply create a custom GUISkin and add it to the element declaration. However if your ARE NOT making editor extensions, I highly suggest you do not use GUILayout and instead use the new UnityEngine.UI. Which is even easier to change the look of. To make a new GUISkin, simply right click on your file-system in Unity, and go to Create > GUISkin. In your MonoScript you can add a public GUISkin mySkin
and drag'n'drop the GUISkin into the script.
EDIT: If you want multiple colors and such throughout your GUI, I'd suggest doing the GUISkin in code, even if you don't though, you can change the colors and whatnot before each new GUI element is declared.
Your answer
Follow this Question
Related Questions
GUI does not contain a definition for `skin' ? 1 Answer
Text color change onHover 2 Answers
How can I create nested buttons ? 2 Answers
Colored 3d Text? 1 Answer
Why can't I get my tooltip to show only when there is a tooltip set? 2 Answers