Material Box

Material Box

WEB Design & Material Images

Godot - Changing the Outline Color and Size of a RichTextLabel

Godot

This code example shows how to change the default outline color and size in a RichTextLabel using GDScript.
This method is not available for the Label node.


You can change the default outline color in RichTextLabel by specifying the `font_outline_color` property with `add_theme_color_override()`.
You can change the default outline size in RichTextLabel by specifying the `outline_size` property with `add_theme_constant_override()`.

var label = RichTextLabel.new()
add_child(label)
label.global_position = Vector2(0, 0)
label.size = Vector2(200,200)
label.text = "Change Font Outline"

# Change the default outline color in RichTextLabel
label.add_theme_color_override("font_outline_color", Color("#FF2222", 1))

# Change the default outline size in RichTextLabel
label.add_theme_constant_override("outline_size", 10)

Godot

TitleGodot - Changing the Outline Color and Size of a RichTextLabel

CategoryGodot

Created

Update

AuthorYousuke.U