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...
CharFXTransform¶
Inherits: RefCounted < Object
控制单个字符在 RichTextEffect 中的显示方式。
Description¶
通过在此对象上设置各种属性,可以控制单个字符在 RichTextEffect 中的显示方式。
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Property Descriptions¶
Color color = Color(0, 0, 0, 1)
绘制字符所用的颜色。
float elapsed_time = 0.0
自 RichTextLabel 被添加到场景树以来经过的时间(单位:秒)。时间在 RichTextLabel 暂停时停止(参见 Node.process_mode)。在 RichTextLabel 中的文本改变时重置。
注意:当 RichTextLabel 被隐藏时,时间仍在流逝。
Dictionary env = {}
void set_environment ( Dictionary value )
Dictionary get_environment ( )
包含在开头的 BBCode 标记中传递的参数。默认情况下,参数是字符串。如果它们的内容与 bool、int、float 之类的类型匹配,它们将被自动转换。格式为 #rrggbb
或 #rgb
的颜色代码将转换为不透明的 Color。字符串参数即使使用引号也不能包含空格。如果存在,引号也将出现在最终字符串中。
例如,开头的 BBCode 标签 [example foo = hello bar = true baz = 42 color =#ffffff]
将映射到以下 Dictionary:
{"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)}
RID font = RID()
用于渲染字形的字体资源。
int glyph_count = 0
字素簇中的字形数量。该值在簇的第一个字形中设置。设置此属性不会影响绘制。
int glyph_flags = 0
字形标志。详情见 GraphemeFlag。设置此属性不会影响绘制。
int glyph_index = 0
字体特定字形的索引。
Vector2 offset = Vector2(0, 0)
绘制字符的位置偏移量(单位:像素)。
bool outline = false
如果为 为true
,则调用 FX 变换进行轮廓绘制。设置该属性不会影响绘制。
Vector2i range = Vector2i(0, 0)
该字符串中的绝对字符范围,对应于字形。设置该属性不会影响绘制。
int relative_index = 0
该字形的字符偏移量,相对于当前 RichTextEffect 自定义块。设置该属性不会影响绘制。
bool visible = true