Replies: 2 comments
-
You don't need the extremes of duplicated themes or generating a complete theme from a script. Although both extremes are possible. You can instead: modify the theme from a script. For the use case of only a few properties being different this should not be much trouble. And if you are going to have a method that modifies the theme in multiple ways for different situations, it might have a parameter you use to tell which set of changes to make, and you might call that parameter "design token". |
Beta Was this translation helpful? Give feedback.
-
I started working on such a prototype, but didn't have time to finish it: https://github.com/Calinou/godot-theme-generator It is definitely possible, it's just a fair amount of effort (especially if you want to provide enough flexibility for real world projects). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
'design tokens' are variables that affect a GUI theme overall, like panel corner radius or accent color.
this would be useful for DARS generator, an app that switches between 3 near-identical themes where only 3 colors are swapped out in each. in DARS generator version [2023].0, these themes are actual duplicated files.
design tokens would also be very useful in future games, where i want to change the GUI colors based on the environment where the player character is, and based on accessibility settings like 'high contrast'.
most likely it's much better to not build design tokens into Godot, but expect the developer to procedurally generate the theme with a script if it should adjust based on changing design tokens.
maybe there should be a repository of free and open-source scripts for procedurally generating themes, each one having a different visual style and different design tokens exposed as variables in the Inspector.
Beta Was this translation helpful? Give feedback.
All reactions