Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Can't change color on GUI.Window

Discussion in 'Scripting' started by Mish, Jan 6, 2016.

  1. Mish

    Mish

    Joined:
    Apr 23, 2010
    Posts:
    96
    I have come accross a very strange issue. I am making a lot of windows in order to connect them as nodes.

    Code (CSharp):
    1. GUI.Window(i, windowRect, DrawWindow, title)
    Some of these windows had assigned difference colors through GUI.Color. Everything was working fine until some day ALL the windows were gray (uncolored).

    I am not sure what caused this since everything else including labels in the windows are getting the correct color. Everything except the window itself.

    Even setting GUI.Color right before the window is drawn doesnt help.

    Code (CSharp):
    1. GUI.Color = Color.red;
    2. GUI.Window(i, windowRect, DrawWindow, title);
    What else could affect the color of only the windows? (I am using Unity 5.3.1 p1)
     
  2. eline_nerrad

    eline_nerrad

    Joined:
    Jan 20, 2016
    Posts:
    3
    I'm also having this problem. The upgrade to 5.3.1 seems to have broke colors with GUI.Window. Has anyone heard anything about a potential fix for this?
     
  3. zoran404

    zoran404

    Joined:
    Jan 11, 2015
    Posts:
    520
    Have you considered to switch to the magical land of UnityEgine.UI namespace?
     
  4. eline_nerrad

    eline_nerrad

    Joined:
    Jan 20, 2016
    Posts:
    3
    This is for a node based tool in an EditorWindow... not sure the new UI tools would help. Plus, it's a tool that we've been using for a few years, which just magically stopped working in the new release. Would rather not re-code the entire thing :)
     
  5. zoran404

    zoran404

    Joined:
    Jan 11, 2015
    Posts:
    520
    Oh sorry, didn't realize that, just saw GUI.something haha

    I didn't saw that they changed anything about that in this build, so it might be a bug.
    Are you using the latest patch?
    Consider submitting a bug report if nothing can fix it.
     
  6. Mish

    Mish

    Joined:
    Apr 23, 2010
    Posts:
    96
    Since im not the only one with this strange issue, I have submitted it as a bug :)
     
  7. eline_nerrad

    eline_nerrad

    Joined:
    Jan 20, 2016
    Posts:
    3
    I had filed a bug last night, so now I guess there's at least 2 of them :)

    I did come up with a workaround that wasn't too painful though. I just took a white texture, stretched it to be as large as the window, and then changed the GUI.color before drawing it. That seems to work. The only difference is the title bar and text at the top of the window will still be grey, but I can live with it.
     
  8. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Nice. Found this while wondering why my editor windows aren't changing colors anymore. Seems like 5.3 broke just one more thing.
     
  9. MattSawrey

    MattSawrey

    Joined:
    Feb 4, 2014
    Posts:
    13
    Anyone know if there has been any progress on this issue? I'm putting together a custom node editor and I've just come across it.