Godot Version
Godot Engine v4.5.1.stable.steam.f62fdbde1
Question
I have a script in the main menu of my game, which is just interpolating the glyph spacing of the title, the issue is towards the end of the interpolation it appears to be "skipping frames" even though the game is running at a high framerate, how can I assure the effect goes smoothly?
Relevant code
var font
var embolden = -1.5
var glyph_spacing = -20.0
func _ready() → void:
font = label_title.get_theme_font(“font”)
func _process(delta: float) → void:
# Title font effects
if font:
if layer_menu.visible:
label_title.global_position.y = lerp(label_title.global_position.y,88.0, 0.05)
glyph_spacing = lerp(glyph_spacing, 20.0, 0.025)
#if embolden <= -1.4:
#embolden = lerp(font.embolden, 1.5, 0.05)
#if embolden >= 1.4:
#embolden = lerp(font.embolden, -1.5, 0.05)
else:
glyph_spacing = 100.0
font.set_spacing(TextServer.SPACING_GLYPH, float(glyph_spacing))
Notes
When I use move_toward() it works fine, but it’s not easing like lerp()
Is it the case that the font spacing can’t work with very low float values?
I would also like to interpolate the embolding of the font, could anyone help me with that?
I tried set_embolding() like set_spacing() but it seems as it doesn’t exist.