Godot - RichTextLabelのアウトラインの色とサイズを変更する
RichTextLabelでデフォルトのアウトラインの色とサイズを変更するGDScriptのコード例です。
この方法はLabelノードでは利用できません。
add_theme_color_override()
で「font_outline_color」プロパティを指定する事でRichTextLabelでのデフォルトのアウトラインの色を変更する事が可能です。add_theme_constant_override()
で「outline_size」プロパティを指定する事でRichTextLabelでのデフォルトのアウトラインのサイズを変更する事が可能です。
var label = RichTextLabel.new()
add_child(label)
label.global_position = Vector2(0, 0)
label.size = Vector2(200,200)
label.text = "Change Font Outline"
# RichTextLabelでデフォルトのアウトラインの色を変更する
label.add_theme_color_override("font_outline_color", Color("#FF2222", 1))
# RichTextLabelでデフォルトのアウトラインのサイズを変更する
label.add_theme_constant_override("outline_size", 10)
![Godot](/images/godot/image.png)