RichTextEffect.xml 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="RichTextEffect" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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. [codeblock]
  10. # The RichTextEffect will be usable like this: `[example]Some text[/example]`
  11. var bbcode = "example"
  12. [/codeblock]
  13. [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.
  14. </description>
  15. <tutorials>
  16. <link>$DOCS_URL/tutorials/ui/bbcode_in_richtextlabel.html</link>
  17. <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
  18. </tutorials>
  19. <methods>
  20. <method name="_process_custom_fx" qualifiers="virtual">
  21. <return type="bool" />
  22. <argument index="0" name="char_fx" type="CharFXTransform" />
  23. <description>
  24. 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.
  25. </description>
  26. </method>
  27. </methods>
  28. <constants>
  29. </constants>
  30. </class>