0.2.0-dev Download ZIP
33 lines ·1.7 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="RichTextEffect" inherits="Resource" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A custom effect for a [RichTextLabel]. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | A custom effect for a [RichTextLabel], which can be loaded in the [RichTextLabel] inspector or using [method RichTextLabel.install_effect]. |
| 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 skip-lint] |
| 11 | # The RichTextEffect will be usable like this: `[example]Some text[/example]` |
| 12 | var bbcode = "example" |
| 13 | [/gdscript] |
| 14 | [csharp skip-lint] |
| 15 | // The RichTextEffect will be usable like this: `[example]Some text[/example]` |
| 16 | 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">$DOCS_URL/tutorials/ui/bbcode_in_richtextlabel.html</link> |
| 23 | </tutorials> |
| 24 | <methods> |
| 25 | <method name="_process_custom_fx" qualifiers="virtual const"> |
| 26 | <return type="bool" /> |
| 27 | <param index="0" name="char_fx" type="CharFXTransform" /> |
| 28 | <description> |
| 29 | Override this method to modify properties in [param char_fx]. 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. |
| 30 | </description> |
| 31 | </method> |
| 32 | </methods> |
| 33 | </class> |