Godot - RichTextLabelのテキストの影をカスタマイズする
GDScriptでRichTextLabelでデフォルトのテキストの影をカスタマイズする方法とコード例です。
add_theme_color_override()
で「font_shadow_color」プロパティを指定する事でRichTextLabelでのデフォルトのテキストの影の色を変更する事が可能です。
影のサイズはadd_theme_constant_override()
で「shadow_outline_size」でカスタマイズできます。
影の位置をadd_theme_constant_override()
で「shadow_offset_x」と「shadow_offset_y」で調整します。
var label = RichTextLabel.new()
add_child(label)
label.global_position = Vector2(0, 0)
label.size = Vector2(200,200)
label.text = "Line\r\nSeparation"
# 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](/images/godot/image.png)