Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
RichTextEffect
继承: Resource < RefCounted < Object
RichTextLabel 的自定义效果。
描述
RichTextLabel 的自定义效果,可以在 RichTextLabel 检查器中加载或使用 RichTextLabel.install_effect() 加载。
注意:要使用 RichTextEffect,必须在脚本中定义名为 bbcode
的成员变量作为 BBCode 标签。
# 使用 RichTextEffect 的方式是这样的:`[example]Some text[/example]`
var bbcode = "example"
// 使用 RichTextEffect 的方式是这样的:`[example]Some text[/example]`
string bbcode = "example";
注意:只要 RichTextLabel 包含至少一个 RichTextEffect,它就会持续处理效果,除非项目暂停。这可能会对电池寿命产生负面影响。
教程
方法
_process_custom_fx(char_fx: CharFXTransform) virtual const |
方法说明
bool _process_custom_fx(char_fx: CharFXTransform) virtual const 🔗
覆盖该方法以修改 char_fx
中的属性。如果字符可以被成功转换,则该方法必须返回 true
。如果该方法返回 false
,则它将跳过转换以避免显示损坏的文本。