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.

TextLine

Inherits: RefCounted < Object

Holds a line of text.

Description

Abstraction over TextServer for handling a single line of text.

Properties

HorizontalAlignment

alignment

0

Direction

direction

0

String

ellipsis_char

"…"

BitField[JustificationFlag]

flags

3

Orientation

orientation

0

bool

preserve_control

false

bool

preserve_invalid

true

OverrunBehavior

text_overrun_behavior

3

float

width

-1.0

Methods

bool

add_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, length: int = 1, baseline: float = 0.0)

bool

add_string(text: String, font: Font, font_size: int, language: String = "", meta: Variant = null)

void

clear()

void

draw(canvas: RID, pos: Vector2, color: Color = Color(1, 1, 1, 1)) const

void

draw_outline(canvas: RID, pos: Vector2, outline_size: int = 1, color: Color = Color(1, 1, 1, 1)) const

float

get_line_ascent() const

float

get_line_descent() const

float

get_line_underline_position() const

float

get_line_underline_thickness() const

float

get_line_width() const

Rect2

get_object_rect(key: Variant) const

Array

get_objects() const

RID

get_rid() const

Vector2

get_size() const

int

hit_test(coords: float) const

bool

resize_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, baseline: float = 0.0)

void

set_bidi_override(override: Array)

void

tab_align(tab_stops: PackedFloat32Array)


Property Descriptions

HorizontalAlignment alignment = 0

Sets text alignment within the line as if the line was horizontal.


Direction direction = 0

Text writing direction.


String ellipsis_char = "…"

  • void set_ellipsis_char(value: String)

  • String get_ellipsis_char()

Ellipsis character used for text clipping.


BitField[