2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2018-02-27 13:40:43 +01:00
<class name= "Label" inherits= "Control" category= "Core" version= "3.1" >
2017-09-12 22:42:36 +02:00
<brief_description >
2017-09-16 11:54:44 +02:00
Displays plain text in a line or wrapped inside a rectangle. For formatted text, use [RichTextLabel].
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2017-09-16 11:54:44 +02:00
Label displays plain text on the screen. 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 formatting. For that, use [RichTextLabel] instead.
2018-01-09 17:40:19 +01:00
Note that contrarily to most other [Control]s, Label's [member Control.mouse_filter] defaults to MOUSE_FILTER_IGNORE (i.e. it doesn't react to mouse input events).
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<demos >
</demos>
<methods >
<method name= "get_line_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-09-16 11:54:44 +02:00
Returns the amount of lines of text the Label has.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_line_height" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-09-16 11:54:44 +02:00
Returns the font size in pixels.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_total_character_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-09 12:49:12 +02:00
Returns the total length of the text.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_visible_line_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-09 12:49:12 +02:00
Returns the number of lines shown. Useful if the [code]Label[/code] 's height cannot currently display all lines.
2017-09-12 22:42:36 +02:00
</description>
</method>
</methods>
<members >
2017-09-13 08:49:40 +02:00
<member name= "align" type= "int" setter= "set_align" getter= "get_align" enum= "Label.Align" >
2017-09-16 11:54:44 +02:00
Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the [code]ALIGN_*[/code] constants.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "autowrap" type= "bool" setter= "set_autowrap" getter= "has_autowrap" >
2017-09-16 11:54:44 +02:00
If [code]true[/code], wraps the text inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. Default: false.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "clip_text" type= "bool" setter= "set_clip_text" getter= "is_clipping_text" >
2017-09-16 11:54:44 +02:00
If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle. It also lets you scale the node down freely.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "lines_skipped" type= "int" setter= "set_lines_skipped" getter= "get_lines_skipped" >
2017-09-16 11:54:44 +02:00
The node ignores the first [code]lines_skipped[/code] lines before it starts to display text.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "max_lines_visible" type= "int" setter= "set_max_lines_visible" getter= "get_max_lines_visible" >
2017-09-16 11:54:44 +02:00
Limits the lines of text the node shows on screen.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "percent_visible" type= "float" setter= "set_percent_visible" getter= "get_percent_visible" >
2017-09-16 11:54:44 +02:00
Limits the count of visible characters. If you set [code]percent_visible[/code] to 50, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "text" type= "String" setter= "set_text" getter= "get_text" >
2017-09-16 11:54:44 +02:00
The text to display on screen.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "uppercase" type= "bool" setter= "set_uppercase" getter= "is_uppercase" >
2017-09-16 11:54:44 +02:00
If [code]true[/code], all the text displays as UPPERCASE.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "valign" type= "int" setter= "set_valign" getter= "get_valign" enum= "Label.VAlign" >
2017-09-16 11:54:44 +02:00
Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the [code]VALIGN_*[/code] constants.
2017-09-12 22:42:36 +02:00
</member>
2018-01-11 23:38:35 +01:00
<member name= "visible_characters" type= "int" setter= "set_visible_characters" getter= "get_visible_characters" >
Restricts the number of characters to display. Set to -1 to disable.
</member>
2017-09-12 22:42:36 +02:00
</members>
<constants >
2017-11-24 23:16:30 +01:00
<constant name= "ALIGN_LEFT" value= "0" enum= "Align" >
2017-09-12 22:42:36 +02:00
Align rows to the left (default).
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ALIGN_CENTER" value= "1" enum= "Align" >
2017-09-12 22:42:36 +02:00
Align rows centered.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ALIGN_RIGHT" value= "2" enum= "Align" >
2017-09-12 22:42:36 +02:00
Align rows to the right (default).
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ALIGN_FILL" value= "3" enum= "Align" >
2017-09-12 22:42:36 +02:00
Expand row whitespaces to fit the width.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "VALIGN_TOP" value= "0" enum= "VAlign" >
2017-09-12 22:42:36 +02:00
Align the whole text to the top.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "VALIGN_CENTER" value= "1" enum= "VAlign" >
2017-09-12 22:42:36 +02:00
Align the whole text to the center.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "VALIGN_BOTTOM" value= "2" enum= "VAlign" >
2017-09-12 22:42:36 +02:00
Align the whole text to the bottom.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "VALIGN_FILL" value= "3" enum= "VAlign" >
2017-09-12 22:42:36 +02:00
Align the whole text by spreading the rows.
</constant>
</constants>
<theme_items >
<theme_item name= "font" type= "Font" >
</theme_item>
<theme_item name= "font_color" type= "Color" >
</theme_item>
<theme_item name= "font_color_shadow" type= "Color" >
</theme_item>
2018-05-12 09:38:00 +02:00
<theme_item name= "font_outline_modulate" type= "Color" >
</theme_item>
2017-09-12 22:42:36 +02:00
<theme_item name= "line_spacing" type= "int" >
</theme_item>
<theme_item name= "normal" type= "StyleBox" >
</theme_item>
<theme_item name= "shadow_as_outline" type= "int" >
</theme_item>
<theme_item name= "shadow_offset_x" type= "int" >
</theme_item>
<theme_item name= "shadow_offset_y" type= "int" >
</theme_item>
</theme_items>
</class>