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
繼承: RefCounted < Object
控制單個字元在 RichTextEffect 中的顯示方式。
說明
通過在此物件上設定各種屬性,可以控制單個字元在 RichTextEffect 中的顯示方式。
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
屬性說明
Color color = Color(0, 0, 0, 1) 🔗
繪製字元所用的顏色。
自 RichTextLabel 被新增到場景樹以來經過的時間(單位:秒)。時間在 RichTextLabel 暫停時停止(參見 Node.process_mode)。在 RichTextLabel 中的文字改變時重設。
注意:當 RichTextLabel 被隱藏時,時間仍在流逝。
Dictionary env = {} 🔗
void set_environment(value: Dictionary)
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)}
TextServer RID of the font used to render glyph, this value can be used with TextServer.font_* methods to retrieve font information.
Note: Read-only. Setting this property won't affect drawing.
Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster.
Note: Read-only. Setting this property won't affect drawing.
Glyph flags. See GraphemeFlag for more info.
Note: Read-only. Setting this property won't affect drawing.
Glyph index specific to the font. If you want to replace this glyph, use TextServer.font_get_glyph_index() with font to get a new glyph index for a single character.
Vector2 offset = Vector2(0, 0) 🔗
繪製字元的位置偏移量(單位:圖元)。
If true, FX transform is called for outline drawing.
Note: Read-only. Setting this property won't affect drawing.
Vector2i range = Vector2i(0, 0) 🔗
Absolute character range in the string, corresponding to the glyph.
Note: Read-only. Setting this property won't affect drawing.
The character offset of the glyph, relative to the current RichTextEffect custom block.
Note: Read-only. Setting this property won't affect drawing.
Transform2D transform = Transform2D(1, 0, 0, 1, 0, 0) 🔗
void set_transform(value: Transform2D)
Transform2D get_transform()
目前字形的目前變換。它可以被覆寫(例如,透過從曲線驅動位置和旋轉)。您還可以更改現有值以在頂部應用變換其他影響。
如果為 true,將繪製字元。如果為 false,則隱藏字元。隱藏字元周圍的字元將回流以佔用隱藏字元的空間。如果不希望這樣做,可以將它們的 color 設定為Color(1, 1, 1, 0)。