Open dugramen opened 4 months ago
See https://github.com/godotengine/godot/pull/87243 for a draft (adds support for fractional font sizes and different constant types).
See https://github.com/godotengine/godot/pull/87243 for a draft (adds support for fractional font sizes and different constant types).
Awesome! As for the boolean issue, just switching to rounding in those scenarios should be enough right?
Turns out all theme constant and font size types are integers, so animating their values over time can't be smooth
Note that animating font sizes (particularly at sizes above 32) is slow unless using MSDF fonts, as standard DynamicFonts are re-rasterized on the CPU every time their size changes. (This is cached, but you're still forcing a re-render every frame on the first animation cycle.)
Turns out all theme constant and font size types are integers, so animating their values over time can't be smooth
Note that animating font sizes (particularly at sizes above 32) is slow unless using MSDF fonts, as standard DynamicFonts are re-rasterized on the CPU every time their size changes. (This is cached, but you're still forcing a re-render every frame on the first animation cycle.)
Thanks I didn't know that. I guess animated font sizes aren't really too important though. The main thing is animating things like BoxContainer spacing and MarginContainer margins
Describe the project you are working on
Currently building a solution to theme animations in godot
Describe the problem or limitation you are having in your project
Turns out all theme constant and font size types are integers, so animating their values over time can't be smooth
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Floats would allow smooth transitions
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
theme_constant
andtheme_font_size
should use float instead. For any theme constant that may actually need an integer, just floor or round the floatIf this enhancement will not be used often, can it be worked around with a few lines of script?
No. Since theme constants are the only way to configure nodes like HBoxContainer, such nodes can't have float constants
Is there a reason why this should be core and not an add-on in the asset library?
Theme constant and theme font size handling are core