You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/classes/RichTextLabel.xml
+22-1Lines changed: 22 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,28 @@
225
225
<returntype="void" />
226
226
<paramindex="0"name="effect"type="Variant" />
227
227
<description>
228
-
Installs a custom effect. [param effect] should be a valid [RichTextEffect].
228
+
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].
229
+
Example RichTextEffect:
230
+
[codeblock]
231
+
# effect.gd
232
+
class_name MyCustomEffect
233
+
extends RichTextEffect
234
+
235
+
var bbcode = "my_custom_effect"
236
+
237
+
# ...
238
+
[/codeblock]
239
+
Registering the above effect in RichTextLabel from script:
240
+
[codeblock]
241
+
# rich_text_label.gd
242
+
extends RichTextLabel
243
+
244
+
func _ready():
245
+
install_effect(MyCustomEffect.new())
246
+
247
+
# Alternatively, if not using `class_name` in the script that extends RichTextEffect:
0 commit comments