Material Box

Material Box

WEBデザイン & フリー素材

Godot - RichTextLabelのテキストを太字にする

Godot

GDScriptでBBCodeを利用してRichTextLabelノードのテキストを太字にするコード例です。
この方法はLabelノードでは利用できません。


「bbcode_enabled」プロパティを有効にします。
太字にしたいテキストを[b]タグで囲います。

var label = RichTextLabel.new()
add_child(label)
label.global_position = Vector2(0, 0)
label.size = Vector2(200,200)

# RichTextLabelの文字を太字にする
label.bbcode_enabled = true
label.text = "[b]Bold Text[/b]"

Godot

TitleGodot - RichTextLabelのテキストを太字にする

CategoryGodot

Created

Update

AuthorYousuke.U