Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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

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 ( Variant key, Vector2 size, InlineAlignment inline_align=5, int length=1, float baseline=0.0 )

bool

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

void

clear ( )

void

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

void

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

float

get_line_ascent ( ) const

float

get_line_descent ( ) const