Table of Contents

Class CharFXTransform

Controls how an individual character will be displayed in a RichTextEffect.

Inheritance
CharFXTransform

Remarks

By setting various properties on this object, you can control how individual characters will be displayed in a RichTextEffect.

See Also

Properties

color

The color the character will be drawn with.

var color : Color = Color(0, 0, 0, 1)

Property Value

Color

Remarks

elapsed_time

The time elapsed since the RichTextLabel was added to the scene tree (in seconds). Time stops when the RichTextLabel is paused (see process_mode). Resets when the text in the RichTextLabel is changed.

Note: Time still passes while the RichTextLabel is hidden.

var elapsed_time : float = 0.0

Property Value

float

Remarks

  • void set_elapsed_time(float value)
  • float get_elapsed_time

env

Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as bool, int or float, they will be converted automatically. Color codes in the form #rrggbb or #rgb will be converted to an opaque Color. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string.

For example, the opening BBCode tag [example foo=hello bar=true baz=42 color=#ffffff] will map to the following Dictionary:

{"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)}

var env : Dictionary = {}

Property Value

Dictionary

Remarks

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.

var font : RID = RID()

Property Value

RID

Remarks

  • void set_font(RID value)
  • RID get_font

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.

var glyph_count : int = 0

Property Value

int

Remarks

  • void set_glyph_count(int value)
  • int get_glyph_count

glyph_flags

Glyph flags. See GraphemeFlag for more info.

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

var glyph_flags : int = 0

Property Value

int

Remarks

  • void set_glyph_flags(int value)
  • int get_glyph_flags

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.

var glyph_index : int = 0

Property Value

int

Remarks

  • void set_glyph_index(int value)
  • int get_glyph_index

offset

The position offset the character will be drawn with (in pixels).

var offset : Vector2 = Vector2(0, 0)

Property Value

Vector2

Remarks

outline

If true, FX transform is called for outline drawing.

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

var outline : bool = false

Property Value

bool

Remarks

  • void set_outline(bool value)
  • bool is_outline

range

Absolute character range in the string, corresponding to the glyph.

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

var range : Vector2i = Vector2i(0, 0)

Property Value

Vector2i

Remarks

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.

var relative_index : int = 0

Property Value

int

Remarks

  • void set_relative_index(int value)
  • int get_relative_index

transform

The current transform of the current glyph. It can be overridden (for example, by driving the position and rotation from a curve). You can also alter the existing value to apply transforms on top of other effects.

var transform : Transform2D = Transform2D(1, 0, 0, 1, 0, 0)

Property Value

Transform2D

Remarks

visible

If true, the character will be drawn. If false, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their color to Color(1, 1, 1, 0) instead.

var visible : bool = true

Property Value

bool

Remarks

  • void set_visibility(bool value)
  • bool is_visible