RichTextEffect.xml 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="RichTextEffect" inherits="Resource" version="4.0">
  3. <brief_description>
  4. A custom effect for use with [RichTextLabel].
  5. </brief_description>
  6. <description>
  7. A custom effect for use with [RichTextLabel].
  8. [b]Note:[/b] For a [RichTextEffect] to be usable, a BBCode tag must be defined as a member variable called [code]bbcode[/code] in the script.
  9. [codeblocks]
  10. [gdscript]
  11. # The RichTextEffect will be usable like this: `[example]Some text[/example]`
  12. var bbcode = "example"
  13. [/gdscript]
  14. [csharp]
  15. // The RichTextEffect will be usable like this: `[example]Some text[/example]`
  16. public string bbcode = "example";
  17. [/csharp]
  18. [/codeblocks]
  19. [b]Note:[/b] As soon as a [RichTextLabel] contains at least one [RichTextEffect], it will continuously process the effect unless the project is paused. This may impact battery life negatively.
  20. </description>
  21. <tutorials>
  22. <link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/ui/bbcode_in_richtextlabel.html</link>
  23. <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
  24. </tutorials>
  25. <methods>
  26. <method name="_process_custom_fx" qualifiers="virtual const">
  27. <return type="bool" />
  28. <argument index="0" name="char_fx" type="CharFXTransform" />
  29. <description>
  30. Override this method to modify properties in [code]char_fx[/code]. The method must return [code]true[/code] if the character could be transformed successfully. If the method returns [code]false[/code], it will skip transformation to avoid displaying broken text.
  31. </description>
  32. </method>
  33. </methods>
  34. </class>