- Home /
Change GUI.DragWindow() color
I have a custom editor with lots of GUI.DragWindows. I'm trying to change the color of these windows, but changing GUI.color ALA:
GUI.color = Color.Green; GUI.DragWindow();
doesn't work.
I've also tried GUI.backgroundColor and GUI.contentColor and neither of those work. How do I do this?
Any help is appreciated.
Thanks, Matt
Answer by Bunny83 · Oct 23, 2016 at 11:32 AM
I'm not sure what you actually want to change... GUI.DragWindow
is a pure functional method. It doesn't render anything. It has to be called inside a window callback in order to drag that window around. If you want to change the window color, you have to change the color before your GUI.Window
/ GUILayout.Window
call.
Good point!
$$anonymous$$y custom editor is drawing windows exactly as is set out here:
https://docs.unity3d.com/ScriptReference/EditorWindow.BeginWindows.html
I've tried calling "GUI.Color = Color.Green;" just before the GUI.Window(), but it isn't changing the color
I want the colour of that actual window to be changed.
Thanks, $$anonymous$$att
Your answer
Follow this Question
Related Questions
How to change Normal color, Highlighted color etc. in 4.6 buttons with code 2 Answers
JS changing gui box color 1 Answer
Fading an image drawn with GUI.DrawTexture 1 Answer
Changing the tint colour of materials 1 Answer
Gui list and color 0 Answers