Material Box

Material Box

WEB Design & Material Images

Godot - Customizing Text Shadows in a RichTextLabel

Godot

This code example shows how to customize the default text shadow in a RichTextLabel using GDScript.


You can change the default text shadow color in a RichTextLabel by specifying the `font_shadow_color` property with `add_theme_color_override()`.
You can customize the shadow size with `shadow_outline_size` using `add_theme_constant_override()`.
You can adjust the shadow position with `shadow_offset_x` and `shadow_offset_y` using `add_theme_constant_override()`.

var label = RichTextLabel.new()
add_child(label)
label.global_position = Vector2(0, 0)
label.size = Vector2(200,200)
label.text = "Line\r\nSeparation"

# Customize the default text shadow in RichTextLabel
label.add_theme_color_override("font_shadow_color", Color("#000", 1))
label.add_theme_constant_override("shadow_outline_size", 10)
label.add_theme_constant_override("shadow_offset_x", 10)
label.add_theme_constant_override("shadow_offset_y", 10)

Godot

TitleGodot - Customizing Text Shadows in a RichTextLabel

CategoryGodot

Created

Update

AuthorYousuke.U