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,該值可以通過 TextServer.font_* 方法來檢索字型資訊。
注意:只讀。設定該屬性不影響繪製。
字素簇中的字形數量。該值在簇的第一個字形中設定。
注意:只讀。設定該屬性不會影響繪製。
字形標誌。詳見 GraphemeFlag。
注意:只讀。設定該屬性不會影響繪製。
特定於 font 的字形索引。如果你想替換該字形,請使用 font 呼叫 TextServer.font_get_glyph_index() 取得單個字元的新字形索引。
Vector2 offset = Vector2(0, 0) 🔗
繪製字元的位置偏移量(單位:圖元)。
如果為 true,則呼叫 FX 變換進行輪廓繪製。
注意:只讀。設定該屬性不會影響繪製。
Vector2i range = Vector2i(0, 0) 🔗
該字串中的絕對字元範圍,對應於字形。
注意:只讀。設定該屬性不會影響繪製。
該字形的字元偏移量,相對於目前 RichTextEffect 自訂塊。
注意:只讀。設定該屬性不會影響繪製。
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)。