Material Box

Material Box

WEBデザイン & フリー素材

Godot - RichTextLabelのテキストの色を変更する

Godot

RichTextLabelでデフォルトのテキストの色を変更するGDScriptのコード例です。
この方法はLabelノードでは利用できません。


add_theme_color_override()で「default_color」プロパティを指定する事でRichTextLabelでのデフォルトの文字色を変更する事が可能です。

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

# RichTextLabelでデフォルトのテキストの色を変更する
label.add_theme_color_override("default_color", Color("#000", 1))

Godot

TitleGodot - RichTextLabelのテキストの色を変更する

CategoryGodot

Created

Update

AuthorYousuke.U