How can the outline of the text on a button be changed when the mouse hovers over it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Austin

I noticed this might be a limitation. I am playing around with themes at the moment and I managed to change the font color for accel, disabled, hover and normal. Under fonts I can set the size and outline color but there is no option for hover vs normal.

Ram | 2020-02-06 03:50

:bust_in_silhouette: Reply From: Byo

I see this is an old question, but if anybody stumbles upon it, this is how I solved it:

Add the script below to the button

extends Button

var custom_font = get("custom_fonts/font")

func _process(_delta):
	if is_hovered():
		custom_font.outline_color = Color.red
	else:
		custom_font.outline_color = Color.black

For this to work for the button, don’t forget to add in the Inspector under Control / Theme Overrides / Fonts / Font a DynamicFont and set the Outline Size to your liking.