I’m totally new to Godot (it’s great overall btw :D), so it might be I miss some basic knowledge. Searching the Internet didn’t yield anything useful though, thus asking:
How do I use a theme to change the color of a Window node? I’d like to change both color of the border and the content background.
I know that my theme is connected correctly, as I can change the “title_color” and see the text color (of the window title) to change. However, I can’t find a way to change the color of the frame and the background.
I believe “embedded_border” is what I need. However, adding it and setting to StyleBoxFlat makes the frame to disappear completely, even though I set a color there (see the image)! And for the window content, I’ve no clue where to look for a correct setting
Yeah, that’s what I meant. TBH I’ve never tried customizing these windows. I took a look at it when you posted. I can look a little more, but it’s worth asking how come you want to use a window node? What are you trying to accomplish? There’s probably an easier way to do what you’re trying to do.
What I try to accomplish is basically to have a few user-adjustable windows (movable, resizeable…) with UI controls inside, visible and usable at the same time.
More broadly, I’m trying to design a simple strategy game. The main map is meant to be always visible, but the player should have a possibility to open multiple windows on top of it, with things like unit info, statistics, minimaps… and arrange them in a way they wish.
Try using a CanvasLayer node as the root, and build each layer on that. If you really want the Window functionality of moving, maximizing and minimizing, then you can just insert them into Window nodes and use anchors to have them fill up the space…
(I’ve added another window for comparison, but it shouldn’t matter)
Now I’m not sure, do you suggest that I should replace the root “Control” by a CanvasLayer ? (Control already inherits from CanvasLayer AFAIK). Or do you mean I should wrap a Label with another intermediate CanvasLayer (this one iherits from it too)?
Or do you mean I refrain from styling the window and only style the child (Label or whatever I put there)? In this case I would only be able to change the content color, but not the window’s border… (correct me if I’m wrong about that)
It doesn’t seem have any support for theming though, so I’ve added some glue code to extract values from Theme and pass them over to the subnodes (pieces of the “window”). It seems to do the trick.