Over the vacations Passive Star launched the Godot Minimal Theme 2.0. I’ve used the Godot Minimal Theme since it was launched again in April 2024 and I nonetheless imagine that it makes Godot look about pretty much as good as attainable (clearly this can be a matter of opinion). The two.0 launch brings a number of new options to the fold:
A number of weeks in the past Yuri Sizov reached out to me and steered utilizing a built-in script on the theme useful resource itself to mix the common and HiDPI theme sources into one. Initially he steered to embed two (or extra) theme chunks right into a single useful resource and merge them collectively utilizing
Theme.merge_with()
relying on chosen editor settings.After some dialogue we determined that as an alternative of merging two sources it makes extra sense to only generate the entire thing fully from code similar to it’s achieved within the built-in theme. This offers essentially the most management with the least quantity of strains.
This made the theme shrink by 1.3K LOC (~150%), although it does far more now:
This is because of the truth that the excessive dpi file is just not wanted anymore as a result of the theme can learn editor scale from editor settings to calculate the proper margins.
Btw Yuri additionally wrote an in-depth article about this concept, you’ll be able to test it out right here!
The concept is straightforward – no matter goes into the
_init()
methodology of the useful resource script will get executed when the theme is loaded, so we will make calls toset_constant()
,set_stylebox()
,set_color()
, and so on to generate the theme from the theme itself. In fact because it’s GDScript we will additionally learn editor settings from it similar to from some other software script.And it will get higher – the
_init()
runs each time any of the theme-related settings are modified within the editor settings. So if you change the bottom coloration or the spacing values godot will regenerate the customized theme robotically utilizing these values.It took a number of hours to transform the theme from a useful resource to a script. But it surely took for much longer than that to get rid of all of redundancy, be certain the entire related editor settings are supported and take a look at every little thing.
Key Hyperlinks
Godot Minimal Theme 2.0 Github
PassiveStar Weblog concerning the theme
Yuri’s Article on Dynamic Themes in Godot
You’ll be able to study extra concerning the Godot Minimal Theme 2.0, see a number of variations of Godot going again to 1.1 and see the brand new theme in motion within the video under.