Changing Texture Colors for buttons like OptionButton or CheckButton

Godot Version



This question is about theming and the textures that are built in to a number of GUI nodes.

Many controls contain “built-in” parts which are actually just textures representing different states, like the “toggle” visual on a CheckButton, the check mark or “blank” (unchecked) box for a CheckBox, or the “radio button” style visuals that appear in the popup menu of an OptionButton. These tend to be grayscale by default.

To my knowledge, none of the color settings in the themes will actually modify these textures. (Am I wrong there?) If I’m not wrong, does this mean that one must either somehow copy these textures and edit them externally to the desired colors, or maybe perform some other hijinks in code? Or just replace them with one’s own textures? (If so, what are the parameters; like what size should they be?)

I assume the vast majority of people using custom themes must be setting the colors of these icons to match their own themes, which makes me assume it can’t really be that tedious or hard to change these, and maybe I’m missing something?

If one does have to directly edit the textures, is there any obvious way in the editor to access the default textures? They are visible by default, but I don’t see any way to, for example, select them from a load option.

Is there any documentation on this particular issue; I didn’t really see it come up in the GUI and Theming tutorials.

Thanks for any tips!

I think they are icons/textures.

I wonder if they are modifiable, not sure how themecache is used, maybe just need to look at those theme attributes listed in that picture.

1 Like

Thanks for the follow-up! I guess, if I wanted to tweak them, I might be able to find the original textures in the Godot source?

When you create a checkbox for example, you can change the checkmark or radiobutton with the Icons section under theme overrides.

1 Like

I played around with it and found a roundabout way to get at them, so if you have a theme you can add a checkbox type and there you have access to the textures.

Then to access them elsewhere. I right clicked to copy, used a sprite2d to paste them saved as a resource. But from there I couldnt find a good way to edit them.

1 Like

Btw I was able to save it as a png and could use it with external editor. But I couldn’t find a way to edit it in engine.

That works! This is very helpful, thanks!