I’m trying to make some UI for a game and want to set monochrome background colors to different panels covering parts of the screen. However, Godot seems to think everything should be some shade of gray by default and the panels I create are transparent, causing everything to be dark. I set the alpha all the way up to 255 but it still makes them transparent. How do I fix this and make the panels be the colors I want them to be?
you need a theme. go to the first Control in your UI and assign a new theme. all children inherit the theme from their parent.
in there you can press the + button to change the default aspect of each Control node.
do this with Panel and change the stylebox to either a StyleBoxFlat or StyleBoxTexture.
with all StyleBoxes you can define margins or extend the box out.
StyleBoxFlat allows you to assign a custom color, an outline, round or angled corners, slanting, shadow and blur.
StyleBoxTexture allows you to use a texture that can be treated by the stylebox as a 9slice (or not), you can set tiling, use a region or scale.
here’s a tutorial from the docs, or look for one on youtube:
for different panels, create a variation in theme for each different panel and assign it to your node by typing the name you chose for it in theme_type_variation.
at this point you can speed up the workflow by duplicating panels that have this assigned already.
you can also select multiple nodes and change their properties at the same time.
that is the default theme.
you need to create a new theme for your game.
I would say using theme overrides is bad practice. setting up a new theme takes some effort at first but saves you a lot of work later on. while using a theme override only affects one Control at a time.