rich_text_bbcode.tscn 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [gd_scene load_steps=10 format=2]
  2. [ext_resource path="res://rich_text_bbcode.gd" type="Script" id=1]
  3. [ext_resource path="res://Titillium-BoldItalic.otf" type="DynamicFontData" id=2]
  4. [ext_resource path="res://Titillium-RegularItalic.otf" type="DynamicFontData" id=3]
  5. [ext_resource path="res://Titillium-Bold.otf" type="DynamicFontData" id=4]
  6. [ext_resource path="res://Titillium-Regular.otf" type="DynamicFontData" id=5]
  7. [sub_resource type="DynamicFont" id=1]
  8. size = 20
  9. font_data = ExtResource( 2 )
  10. [sub_resource type="DynamicFont" id=2]
  11. size = 20
  12. font_data = ExtResource( 3 )
  13. [sub_resource type="DynamicFont" id=3]
  14. size = 20
  15. font_data = ExtResource( 4 )
  16. [sub_resource type="DynamicFont" id=4]
  17. size = 20
  18. font_data = ExtResource( 5 )
  19. [node name="RichTextBBCode" type="Control"]
  20. anchor_left = 0.5
  21. anchor_top = 0.5
  22. anchor_right = 0.5
  23. anchor_bottom = 0.5
  24. margin_left = -512.0
  25. margin_top = -300.0
  26. margin_right = 512.0
  27. margin_bottom = 300.0
  28. size_flags_horizontal = 2
  29. size_flags_vertical = 2
  30. script = ExtResource( 1 )
  31. [node name="RichTextLabel" type="RichTextLabel" parent="."]
  32. anchor_right = 1.0
  33. anchor_bottom = 1.0
  34. margin_left = 49.0
  35. margin_top = 55.0
  36. margin_right = -48.0
  37. margin_bottom = -62.0
  38. size_flags_horizontal = 2
  39. size_flags_vertical = 2
  40. custom_fonts/bold_italics_font = SubResource( 1 )
  41. custom_fonts/italics_font = SubResource( 2 )
  42. custom_fonts/bold_font = SubResource( 3 )
  43. custom_fonts/normal_font = SubResource( 4 )
  44. bbcode_enabled = true
  45. bbcode_text = "[b][u]Rich Text Test[/u][/b]
  46. RichTextLabel is a flexible way of adding text to your game, with support for [i]italics[/i], [b]bold[/b] and [i][b]both[/b][/i].
  47. [u]Underline[/u] works too, including with [u][i]italics[/i][/u], [u][b]bold[/b][/u] and [u][i][b]both[/b][/i][/u].
  48. It is also possible to include [img]res://unicorn_icon.png[/img] custom images, as well as [color=aqua][url=https://godotengine.org]custom URLs[/url][/color].
  49. Left alignment is default,[center]but center alignment is supported,[/center][right]as well as right alignment.[/right]
  50. [fill]Fill alignment is also supported, and allows writing very long text that will end up fitting the horizontal space entirely with words of joy.[/fill]
  51. For full reference, [color=aqua][url=https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html]check the documentation.[/url][/color]
  52. "
  53. text = "Rich Text Test
  54. RichTextLabel is a flexible way of adding text to your game, with support for italics, bold and both.
  55. Underline works too, including with italics, bold and both.
  56. It is also possible to include custom images, as well as custom URLs.
  57. Left alignment is default,but center alignment is supported,as well as right alignment.
  58. Fill alignment is also supported, and allows writing very long text that will end up fitting the horizontal space entirely with words of joy.
  59. For full reference, check the documentation.
  60. "
  61. __meta__ = {
  62. "_edit_use_anchors_": false
  63. }
  64. [connection signal="meta_clicked" from="RichTextLabel" to="." method="_on_RichTextLabel_meta_clicked"]