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.

CharFXTransform

繼承: RefCounted < Object

控制單個字元在 RichTextEffect 中的顯示方式。

說明

通過在此物件上設定各種屬性,可以控制單個字元在 RichTextEffect 中的顯示方式。

教學

屬性

Color

color

Color(0, 0, 0, 1)

float

elapsed_time

0.0

Dictionary

env

{}

RID

font

RID()

int

glyph_count

0

int

glyph_flags

0

int

glyph_index

0

Vector2

offset

Vector2(0, 0)

bool

outline

false

Vector2i

range

Vector2i(0, 0)

int

relative_index

0

Transform2D

transform

Transform2D(1, 0, 0, 1, 0, 0)

bool

visible

true


屬性說明

Color color = Color(0, 0, 0, 1) 🔗

繪製字元所用的顏色。


float elapsed_time = 0.0 🔗

  • void set_elapsed_time(value: float)

  • float get_elapsed_time()

RichTextLabel 被新增到場景樹以來經過的時間(單位:秒)。時間在 RichTextLabel 暫停時停止(參見 Node.process_mode)。在 RichTextLabel 中的文字改變時重設。

注意:RichTextLabel 被隱藏時,時間仍在流逝。


Dictionary env = {} 🔗

包含在開頭的 BBCode 標記中傳遞的參數。預設情況下,參數是字串。如果它們的內容與 boolintfloat 之類的型別配對,它們將被自動轉換。格式為 #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() 🔗

  • void set_font(value: RID)

  • RID get_font()

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.


int glyph_count = 0 🔗

  • void set_glyph_count(value: int)

  • int get_glyph_count()

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.


int glyph_flags = 0 🔗

  • void set_glyph_flags(value: int)

  • int get_glyph_flags()

Glyph flags. See GraphemeFlag for more info.

Note: Read-only. Setting this property won't affect drawing.


int glyph_index = 0 🔗

  • void set_glyph_index(value: int)

  • int get_glyph_index()

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) 🔗

繪製字元的位置偏移量(單位:圖元)。


bool outline = false 🔗

  • void set_outline(value: bool)

  • bool is_outline()

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.


int relative_index = 0 🔗

  • void set_relative_index(value: int)

  • int get_relative_index()

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) 🔗

目前字形的目前變換。它可以被覆寫(例如,透過從曲線驅動位置和旋轉)。您還可以更改現有值以在頂部應用變換其他影響。


bool visible = true 🔗

  • void set_visibility(value: bool)

  • bool is_visible()

如果為 true,將繪製字元。如果為 false,則隱藏字元。隱藏字元周圍的字元將回流以佔用隱藏字元的空間。如果不希望這樣做,可以將它們的 color 設定為Color(1, 1, 1, 0)