Inherits: Control < CanvasItem < Node < Object
A control for displaying plain text.
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.
| ||
| ||
| ||
BitField<JustificationFlag> |
| |
| ||
| ||
| ||
mouse_filter |
| |
BitField<SizeFlags> | size_flags_vertical |
|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
get_line_count ( ) const | |
get_line_height ( int line=-1 ) const | |
get_total_character_count ( ) const | |
get_visible_line_count ( ) const |
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
0
If set to something other than TextServer.AUTOWRAP_OFF, the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see AutowrapMode.
false
If true, the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally.
0
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the HorizontalAlignment constants.
163
Line fill alignment rules. For more info see JustificationFlag.
A LabelSettings resource that can be shared between multiple Label nodes. Takes priority over theme properties.
""
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
0
The number of the lines ignored and not displayed from the start of the text value.
-1
Limits the lines of text the node shows on screen.
0
Set BiDi algorithm override for the structured text.
[]
Set additional options for BiDi override.
PackedFloat32Array()
Aligns text to the given tab-stops.
""
The text to display on screen.
0
Base text writing direction.
0
Sets the clipping behavior when the text exceeds the node's bounding rectangle. See OverrunBehavior for a description of all modes.
false
If true, all the text displays as UPPERCASE.
0
Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the VerticalAlignment constants.
-1
The number of characters to display. If set to -1, all characters are displayed. This can be useful when animating the text appearing in a dialog box.
Note: Setting this property updates visible_ratio accordingly.
0
Sets the clipping behavior when visible_characters or visible_ratio is set. See VisibleCharactersBehavior for more info.
1.0
The fraction of characters to display, relative to the total number of characters (see get_total_character_count). If set to 1.0, all characters are displayed. If set to 0.5, only half of the characters will be displayed. This can be useful when animating the text appearing in a dialog box.
Note: Setting this property updates visible_characters accordingly.
Returns the number of lines of text the Label has.
Returns the height of the line line.
If line is set to -1, returns the biggest line height.
If there are no lines, returns font size in pixels.
Returns the total number of printable characters in the text (excluding spaces and newlines).
Returns the number of lines shown. Useful if the Label's height cannot currently display all lines.
Color(1, 1, 1, 1)
Default text Color of the Label.
Color(1, 1, 1, 1)
The color of text outline.
Color(0, 0, 0, 0)
Color of the text's shadow effect.
3
Vertical space between lines in multiline Label.
0
Text outline size.
Note: If using a font with FontFile.multichannel_signed_distance_field enabled, its FontFile.msdf_pixel_range must be set to at least twice the value of outline_size for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
Note: Using a value that is larger than half the font size is not recommended, as the font outline may fail to be fully closed in this case.
1
The horizontal offset of the text's shadow.
1
The vertical offset of the text's shadow.
1
The size of the shadow outline.
Font used for the Label's text.
Font size of the Label's text.
Background StyleBox for the Label.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_label.html