diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2023-12-19 17:29:49 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2023-12-19 17:29:49 +0100 |
commit | 78fff7292cfd5938f316dfaea7cc11e4fc570ca3 (patch) | |
tree | 5ce152c82fdd0ad2434bc9b10b521535ad45101b /doc/classes/RichTextLabel.xml | |
parent | 1f5d4a62e9e9a8227ad63155b080fbbfac899571 (diff) | |
download | redot-engine-78fff7292cfd5938f316dfaea7cc11e4fc570ca3.tar.gz |
Improve RichTextLabel `install_effect()` documentation
Diffstat (limited to 'doc/classes/RichTextLabel.xml')
-rw-r--r-- | doc/classes/RichTextLabel.xml | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index c9a48e46b2..85dea1485a 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -225,7 +225,28 @@ <return type="void" /> <param index="0" name="effect" type="Variant" /> <description> - Installs a custom effect. [param effect] should be a valid [RichTextEffect]. + Installs a custom effect. This can also be done in the RichTextLabel inspector using the [member custom_effects] property. [param effect] should be a valid [RichTextEffect]. + Example RichTextEffect: + [codeblock] + # effect.gd + class_name MyCustomEffect + extends RichTextEffect + + var bbcode = "my_custom_effect" + + # ... + [/codeblock] + Registering the above effect in RichTextLabel from script: + [codeblock] + # rich_text_label.gd + extends RichTextLabel + + func _ready(): + install_effect(MyCustomEffect.new()) + + # Alternatively, if not using `class_name` in the script that extends RichTextEffect: + install_effect(preload("res://effect.gd").new()) + [/codeblock] </description> </method> <method name="is_menu_visible" qualifiers="const"> |