Friday, March 14, 2025
HomeApp SecurityGodot Minimal Theme 2.0 from PassiveStar – GameFromScratch.com

Godot Minimal Theme 2.0 from PassiveStar – GameFromScratch.com


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 nearly as good as attainable (clearly it is 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 instructed utilizing a built-in script on the theme useful resource itself to mix the common and HiDPI theme sources into one. Initially he instructed 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 simply generate the entire thing totally from code identical to it’s executed within the built-in theme. This provides essentially the most management with the least quantity of traces.

This made the theme shrink by 1.3K LOC (~150%), although it does rather more now:

This is because of the truth that the excessive dpi file just isn’t 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 easy – no matter goes into the _init() methodology of the useful resource script will get executed when the theme is loaded, so we are able to make calls to set_constant()set_stylebox()set_color(), and so forth to generate the theme from the theme itself. In fact because it’s GDScript we are able to additionally learn editor settings from it identical to from some other instrument script.

And it will get higher – the _init() runs each time any of the theme-related settings are modified within the editor settings. So once 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. Nevertheless it took for much longer than that to remove all of redundancy, ensure the entire related editor settings are supported and check every thing.

Key Hyperlinks

Godot Minimal Theme 2.0 Github

PassiveStar Weblog in regards to the theme

Yuri’s Article on Dynamic Themes in Godot

You may study extra in regards to 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.



Supply hyperlink

RELATED ARTICLES

Most Popular

Recent Comments