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.

Label

Inherits: Control < CanvasItem < Node < Object

A control for displaying plain text.

Description

A control for displaying plain text. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other rich text formatting. For that, use RichTextLabel instead.

Tutorials

Properties

AutowrapMode

autowrap_mode

0

bool

clip_text

false

String

ellipsis_char

"…"

HorizontalAlignment

horizontal_alignment

0

BitField[JustificationFlag]

justification_flags

163

LabelSettings

label_settings

String

language

""

int

lines_skipped

0

int

max_lines_visible

-1

MouseFilter

mouse_filter

2 (overrides Control)

BitField[SizeFlags]

size_flags_vertical

4 (overrides Control)

StructuredTextParser

structured_text_bidi_override

0

Array

structured_text_bidi_override_options

[]

PackedFloat32Array

tab_stops

PackedFloat32Array()

String

text

""

TextDirection

text_direction

0

OverrunBehavior

text_overrun_behavior

0

bool

uppercase

false

VerticalAlignment

vertical_alignment

0

int

visible_characters

-1

VisibleCharactersBehavior

visible_characters_behavior

0

float

visible_ratio

1.0

Methods

Rect2

get_character_bounds(pos: int) const

int

get_line_count() const

int

get_line_height(line: int = -1) const

int

get_total_character_count() const

int

get_visible_line_count() const

Theme Properties

Color

font_color

Color(1, 1, 1, 1)

Color

font_outline_color

Color(0, 0, 0, 1)

Color

font_shadow_color

Color(0, 0, 0, 0)

int