Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Afsar Pasha |
Can I change the custom_constants of a node via script during run time or at least on loading?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Afsar Pasha |
Can I change the custom_constants of a node via script during run time or at least on loading?
Reply From: | Capital-EX |
This may be an old question, but it’s worth answering for anyone else looking this up: in order to change a theme constant you must call add_constant_override("<constant name>", <value>)
.
Documentation source: Control — Godot Engine (3.2) documentation in English
You saved my life! Thank you.
isdran | 2022-03-29 17:28
Reply From: | kuzey |
In Godot 4, you should go like this for theme constant overrides:
add_theme_constant_override(name :String, constant :int)
For instance:
add_theme_constant_override("separation", 10)