Material Box

Material Box

WEB Design & Material Images

Godot - Making a Button Text Outlined

Godot

This code example shows how to make a Button node's text outlined using GDScript.


To make a Button node's text outlined, you can use `add_theme_color_override()` to specify the outline color and `add_theme_constant_override()` to specify the outline size.
The following code example also uses `add_theme_font_size_override()` to make the text larger than the default.

# Create a Button node
var button = Button.new()
add_child(button)
button.text = "Button"

# Font size
button.add_theme_font_size_override("font_size", 30)
# Outline color
button.add_theme_color_override("font_outline_color", Color("#F00", 1))
# Outline size
button.add_theme_constant_override("outline_size", 10)

Godot

TitleGodot - Making a Button Text Outlined

CategoryGodot

Created

Update

AuthorYousuke.U