Files
godot-docs/classes/class_richtextlabel.rst
2017-11-07 11:11:44 +01:00

386 lines
27 KiB
ReStructuredText

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the RichTextLabel.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_RichTextLabel:
RichTextLabel
=============
**Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
**Category:** Core
Brief Description
-----------------
Label that displays rich text.
Member Functions
----------------
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_image<class_RichTextLabel_add_image>` **(** :ref:`Texture<class_texture>` image **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_text<class_RichTextLabel_add_text>` **(** :ref:`String<class_string>` text **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`append_bbcode<class_RichTextLabel_append_bbcode>` **(** :ref:`String<class_string>` bbcode **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_RichTextLabel_clear>` **(** **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_string>` | :ref:`get_bbcode<class_RichTextLabel_get_bbcode>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_line_count<class_RichTextLabel_get_line_count>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_percent_visible<class_RichTextLabel_get_percent_visible>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tab_size<class_RichTextLabel_get_tab_size>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_string>` | :ref:`get_text<class_RichTextLabel_get_text>` **(** **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_total_character_count<class_RichTextLabel_get_total_character_count>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`VScrollBar<class_vscrollbar>` | :ref:`get_v_scroll<class_RichTextLabel_get_v_scroll>` **(** **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_visible_characters<class_RichTextLabel_get_visible_characters>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_visible_line_count<class_RichTextLabel_get_visible_line_count>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_meta_underlined<class_RichTextLabel_is_meta_underlined>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_overriding_selected_font_color<class_RichTextLabel_is_overriding_selected_font_color>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_scroll_active<class_RichTextLabel_is_scroll_active>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_scroll_following<class_RichTextLabel_is_scroll_following>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_selection_enabled<class_RichTextLabel_is_selection_enabled>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_using_bbcode<class_RichTextLabel_is_using_bbcode>` **(** **)** const |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`newline<class_RichTextLabel_newline>` **(** **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`parse_bbcode<class_RichTextLabel_parse_bbcode>` **(** :ref:`String<class_string>` bbcode **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`pop<class_RichTextLabel_pop>` **(** **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_align<class_RichTextLabel_push_align>` **(** :ref:`int<class_int>` align **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_cell<class_RichTextLabel_push_cell>` **(** **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_color<class_RichTextLabel_push_color>` **(** :ref:`Color<class_color>` color **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_font<class_RichTextLabel_push_font>` **(** :ref:`Font<class_font>` font **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_indent<class_RichTextLabel_push_indent>` **(** :ref:`int<class_int>` level **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_list<class_RichTextLabel_push_list>` **(** :ref:`int<class_int>` type **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_meta<class_RichTextLabel_push_meta>` **(** :ref:`Variant<class_variant>` data **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_table<class_RichTextLabel_push_table>` **(** :ref:`int<class_int>` columns **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_underline<class_RichTextLabel_push_underline>` **(** **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`remove_line<class_RichTextLabel_remove_line>` **(** :ref:`int<class_int>` line **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`scroll_to_line<class_RichTextLabel_scroll_to_line>` **(** :ref:`int<class_int>` line **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bbcode<class_RichTextLabel_set_bbcode>` **(** :ref:`String<class_string>` text **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_meta_underline<class_RichTextLabel_set_meta_underline>` **(** :ref:`bool<class_bool>` enable **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_override_selected_font_color<class_RichTextLabel_set_override_selected_font_color>` **(** :ref:`bool<class_bool>` override **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_percent_visible<class_RichTextLabel_set_percent_visible>` **(** :ref:`float<class_float>` percent_visible **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_scroll_active<class_RichTextLabel_set_scroll_active>` **(** :ref:`bool<class_bool>` active **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_scroll_follow<class_RichTextLabel_set_scroll_follow>` **(** :ref:`bool<class_bool>` follow **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_selection_enabled<class_RichTextLabel_set_selection_enabled>` **(** :ref:`bool<class_bool>` enabled **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_tab_size<class_RichTextLabel_set_tab_size>` **(** :ref:`int<class_int>` spaces **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_table_column_expand<class_RichTextLabel_set_table_column_expand>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand, :ref:`int<class_int>` ratio **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_text<class_RichTextLabel_set_text>` **(** :ref:`String<class_string>` text **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_use_bbcode<class_RichTextLabel_set_use_bbcode>` **(** :ref:`bool<class_bool>` enable **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_visible_characters<class_RichTextLabel_set_visible_characters>` **(** :ref:`int<class_int>` amount **)** |
+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_RichTextLabel_meta_clicked:
- **meta_clicked** **(** :ref:`Nil<class_nil>` meta **)**
Member Variables
----------------
.. _class_RichTextLabel_bbcode_enabled:
- :ref:`bool<class_bool>` **bbcode_enabled** - If ``true`` the label uses BBCode formatting. Default value: ``false``.
.. _class_RichTextLabel_bbcode_text:
- :ref:`String<class_string>` **bbcode_text** - The label's text in BBCode format.
.. _class_RichTextLabel_override_selected_font_color:
- :ref:`bool<class_bool>` **override_selected_font_color** - If ``true`` the label uses the custom font color. Default value: ``false``.
.. _class_RichTextLabel_percent_visible:
- :ref:`float<class_float>` **percent_visible** - The text's visibility, as a :ref:`float<class_float>` between 0.0 and 1.0.
.. _class_RichTextLabel_visible_characters:
- :ref:`int<class_int>` **visible_characters** - The restricted number of characters to display in the label.
Numeric Constants
-----------------
- **ALIGN_LEFT** = **0**
- **ALIGN_CENTER** = **1**
- **ALIGN_RIGHT** = **2**
- **ALIGN_FILL** = **3**
- **LIST_NUMBERS** = **0**
- **LIST_LETTERS** = **1**
- **LIST_DOTS** = **2**
- **ITEM_FRAME** = **0**
- **ITEM_TEXT** = **1**
- **ITEM_IMAGE** = **2**
- **ITEM_NEWLINE** = **3**
- **ITEM_FONT** = **4**
- **ITEM_COLOR** = **5**
- **ITEM_UNDERLINE** = **6**
- **ITEM_ALIGN** = **7**
- **ITEM_INDENT** = **8**
- **ITEM_LIST** = **9**
- **ITEM_TABLE** = **10**
- **ITEM_META** = **11**
Description
-----------
Label that displays rich text. Rich text can contain custom text, fonts, images and some basic formatting. It also adapts itself to given width/heights.
Member Function Description
---------------------------
.. _class_RichTextLabel_add_image:
- void **add_image** **(** :ref:`Texture<class_texture>` image **)**
.. _class_RichTextLabel_add_text:
- void **add_text** **(** :ref:`String<class_string>` text **)**
.. _class_RichTextLabel_append_bbcode:
- :ref:`int<class_int>` **append_bbcode** **(** :ref:`String<class_string>` bbcode **)**
.. _class_RichTextLabel_clear:
- void **clear** **(** **)**
Clears the label's text.
.. _class_RichTextLabel_get_bbcode:
- :ref:`String<class_string>` **get_bbcode** **(** **)** const
Returns label's BBCode.
.. _class_RichTextLabel_get_line_count:
- :ref:`int<class_int>` **get_line_count** **(** **)** const
Returns the number of lines in the text.
.. _class_RichTextLabel_get_percent_visible:
- :ref:`float<class_float>` **get_percent_visible** **(** **)** const
Returns the text's visibility as a floating point value between 0.0 and 1.0.
.. _class_RichTextLabel_get_tab_size:
- :ref:`int<class_int>` **get_tab_size** **(** **)** const
.. _class_RichTextLabel_get_text:
- :ref:`String<class_string>` **get_text** **(** **)**
Returns the label's text with the formatting removed.
.. _class_RichTextLabel_get_total_character_count:
- :ref:`int<class_int>` **get_total_character_count** **(** **)** const
Returns the total number of characters.
.. _class_RichTextLabel_get_v_scroll:
- :ref:`VScrollBar<class_vscrollbar>` **get_v_scroll** **(** **)**
.. _class_RichTextLabel_get_visible_characters:
- :ref:`int<class_int>` **get_visible_characters** **(** **)** const
.. _class_RichTextLabel_get_visible_line_count:
- :ref:`int<class_int>` **get_visible_line_count** **(** **)** const
Returns the number of visible lines.
.. _class_RichTextLabel_is_meta_underlined:
- :ref:`bool<class_bool>` **is_meta_underlined** **(** **)** const
.. _class_RichTextLabel_is_overriding_selected_font_color:
- :ref:`bool<class_bool>` **is_overriding_selected_font_color** **(** **)** const
.. _class_RichTextLabel_is_scroll_active:
- :ref:`bool<class_bool>` **is_scroll_active** **(** **)** const
Returns ``true`` if active scrolling is enabled.
.. _class_RichTextLabel_is_scroll_following:
- :ref:`bool<class_bool>` **is_scroll_following** **(** **)** const
.. _class_RichTextLabel_is_selection_enabled:
- :ref:`bool<class_bool>` **is_selection_enabled** **(** **)** const
Returns ``true`` if the label's text can be selected.
.. _class_RichTextLabel_is_using_bbcode:
- :ref:`bool<class_bool>` **is_using_bbcode** **(** **)** const
Returns ``true`` if the label has BBCode.
.. _class_RichTextLabel_newline:
- void **newline** **(** **)**
Adds a newline to the end of the rich text.
.. _class_RichTextLabel_parse_bbcode:
- :ref:`int<class_int>` **parse_bbcode** **(** :ref:`String<class_string>` bbcode **)**
.. _class_RichTextLabel_pop:
- void **pop** **(** **)**
.. _class_RichTextLabel_push_align:
- void **push_align** **(** :ref:`int<class_int>` align **)**
.. _class_RichTextLabel_push_cell:
- void **push_cell** **(** **)**
.. _class_RichTextLabel_push_color:
- void **push_color** **(** :ref:`Color<class_color>` color **)**
.. _class_RichTextLabel_push_font:
- void **push_font** **(** :ref:`Font<class_font>` font **)**
.. _class_RichTextLabel_push_indent:
- void **push_indent** **(** :ref:`int<class_int>` level **)**
.. _class_RichTextLabel_push_list:
- void **push_list** **(** :ref:`int<class_int>` type **)**
.. _class_RichTextLabel_push_meta:
- void **push_meta** **(** :ref:`Variant<class_variant>` data **)**
.. _class_RichTextLabel_push_table:
- void **push_table** **(** :ref:`int<class_int>` columns **)**
.. _class_RichTextLabel_push_underline:
- void **push_underline** **(** **)**
.. _class_RichTextLabel_remove_line:
- :ref:`bool<class_bool>` **remove_line** **(** :ref:`int<class_int>` line **)**
.. _class_RichTextLabel_scroll_to_line:
- void **scroll_to_line** **(** :ref:`int<class_int>` line **)**
.. _class_RichTextLabel_set_bbcode:
- void **set_bbcode** **(** :ref:`String<class_string>` text **)**
Sets the BBCode text to the label.
.. _class_RichTextLabel_set_meta_underline:
- void **set_meta_underline** **(** :ref:`bool<class_bool>` enable **)**
.. _class_RichTextLabel_set_override_selected_font_color:
- void **set_override_selected_font_color** **(** :ref:`bool<class_bool>` override **)**
.. _class_RichTextLabel_set_percent_visible:
- void **set_percent_visible** **(** :ref:`float<class_float>` percent_visible **)**
Sets the text's visibility. Takes a floating point value between 0.0 and 1.0.
.. _class_RichTextLabel_set_scroll_active:
- void **set_scroll_active** **(** :ref:`bool<class_bool>` active **)**
.. _class_RichTextLabel_set_scroll_follow:
- void **set_scroll_follow** **(** :ref:`bool<class_bool>` follow **)**
.. _class_RichTextLabel_set_selection_enabled:
- void **set_selection_enabled** **(** :ref:`bool<class_bool>` enabled **)**
If ``true`` text can be selected.
.. _class_RichTextLabel_set_tab_size:
- void **set_tab_size** **(** :ref:`int<class_int>` spaces **)**
.. _class_RichTextLabel_set_table_column_expand:
- void **set_table_column_expand** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand, :ref:`int<class_int>` ratio **)**
.. _class_RichTextLabel_set_text:
- void **set_text** **(** :ref:`String<class_string>` text **)**
.. _class_RichTextLabel_set_use_bbcode:
- void **set_use_bbcode** **(** :ref:`bool<class_bool>` enable **)**
.. _class_RichTextLabel_set_visible_characters:
- void **set_visible_characters** **(** :ref:`int<class_int>` amount **)**