Search Unity

How do i set the color of GUI.Box when using a GUIStyle?

Discussion in 'Immediate Mode GUI (IMGUI)' started by Sersh, Dec 15, 2017.

  1. Sersh

    Sersh

    Joined:
    Oct 25, 2015
    Posts:
    23
    hey, for the following code

    Code (CSharp):
    1. GUI.color = new Color(0.6f, 0.6f, 0.6f);
    2. GUI.Box(new Rect(EditorPos.x, EditorPos.y, 80, 20), string.Empty, "ScriptStyleHeader");
    3. GUI.color = Color.white;
    As long as i pass a style parameter, it ignores the color is set. Also i don't seem to find any possibility to define the color in the style. How can i display a GUI.Box colored while using a style?

    (this is for an Editor extension)
     
  2. PsyKaw

    PsyKaw

    Joined:
    Aug 16, 2012
    Posts:
    102