123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/LabelSettings.xml.
- .. _class_LabelSettings:
- LabelSettings
- =============
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Provides common settings to customize the text in a :ref:`Label<class_Label>`.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- **LabelSettings** is a resource that provides common settings to customize the text in a :ref:`Label<class_Label>`. It will take priority over the properties defined in :ref:`Control.theme<class_Control_property_theme>`. The resource can be shared between multiple labels and changed on the fly, so it's convenient and flexible way to setup text style.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`Font<class_Font>` | :ref:`font<class_LabelSettings_property_font>` | |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`Color<class_Color>` | :ref:`font_color<class_LabelSettings_property_font_color>` | ``Color(1, 1, 1, 1)`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`font_size<class_LabelSettings_property_font_size>` | ``16`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`float<class_float>` | :ref:`line_spacing<class_LabelSettings_property_line_spacing>` | ``3.0`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`Color<class_Color>` | :ref:`outline_color<class_LabelSettings_property_outline_color>` | ``Color(1, 1, 1, 1)`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`outline_size<class_LabelSettings_property_outline_size>` | ``0`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`float<class_float>` | :ref:`paragraph_spacing<class_LabelSettings_property_paragraph_spacing>` | ``0.0`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`Color<class_Color>` | :ref:`shadow_color<class_LabelSettings_property_shadow_color>` | ``Color(0, 0, 0, 0)`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`shadow_offset<class_LabelSettings_property_shadow_offset>` | ``Vector2(1, 1)`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`shadow_size<class_LabelSettings_property_shadow_size>` | ``1`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`stacked_outline_count<class_LabelSettings_property_stacked_outline_count>` | ``0`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`stacked_shadow_count<class_LabelSettings_property_stacked_shadow_count>` | ``0`` |
- +-------------------------------+----------------------------------------------------------------------------------+-----------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`add_stacked_outline<class_LabelSettings_method_add_stacked_outline>`\ (\ index\: :ref:`int<class_int>` = -1\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`add_stacked_shadow<class_LabelSettings_method_add_stacked_shadow>`\ (\ index\: :ref:`int<class_int>` = -1\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_stacked_outline_color<class_LabelSettings_method_get_stacked_outline_color>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_stacked_outline_size<class_LabelSettings_method_get_stacked_outline_size>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_stacked_shadow_color<class_LabelSettings_method_get_stacked_shadow_color>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`get_stacked_shadow_offset<class_LabelSettings_method_get_stacked_shadow_offset>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_stacked_shadow_outline_size<class_LabelSettings_method_get_stacked_shadow_outline_size>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`move_stacked_outline<class_LabelSettings_method_move_stacked_outline>`\ (\ from_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`move_stacked_shadow<class_LabelSettings_method_move_stacked_shadow>`\ (\ from_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`remove_stacked_outline<class_LabelSettings_method_remove_stacked_outline>`\ (\ index\: :ref:`int<class_int>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`remove_stacked_shadow<class_LabelSettings_method_remove_stacked_shadow>`\ (\ index\: :ref:`int<class_int>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_stacked_outline_color<class_LabelSettings_method_set_stacked_outline_color>`\ (\ index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_stacked_outline_size<class_LabelSettings_method_set_stacked_outline_size>`\ (\ index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_stacked_shadow_color<class_LabelSettings_method_set_stacked_shadow_color>`\ (\ index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_stacked_shadow_offset<class_LabelSettings_method_set_stacked_shadow_offset>`\ (\ index\: :ref:`int<class_int>`, offset\: :ref:`Vector2<class_Vector2>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_stacked_shadow_outline_size<class_LabelSettings_method_set_stacked_shadow_outline_size>`\ (\ index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |
- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_LabelSettings_property_font:
- .. rst-class:: classref-property
- :ref:`Font<class_Font>` **font** :ref:`🔗<class_LabelSettings_property_font>`
- .. rst-class:: classref-property-setget
- - |void| **set_font**\ (\ value\: :ref:`Font<class_Font>`\ )
- - :ref:`Font<class_Font>` **get_font**\ (\ )
- :ref:`Font<class_Font>` used for the text.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_font_color:
- .. rst-class:: classref-property
- :ref:`Color<class_Color>` **font_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LabelSettings_property_font_color>`
- .. rst-class:: classref-property-setget
- - |void| **set_font_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- - :ref:`Color<class_Color>` **get_font_color**\ (\ )
- Color of the text.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_font_size:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **font_size** = ``16`` :ref:`🔗<class_LabelSettings_property_font_size>`
- .. rst-class:: classref-property-setget
- - |void| **set_font_size**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_font_size**\ (\ )
- Size of the text.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_line_spacing:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **line_spacing** = ``3.0`` :ref:`🔗<class_LabelSettings_property_line_spacing>`
- .. rst-class:: classref-property-setget
- - |void| **set_line_spacing**\ (\ value\: :ref:`float<class_float>`\ )
- - :ref:`float<class_float>` **get_line_spacing**\ (\ )
- Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_outline_color:
- .. rst-class:: classref-property
- :ref:`Color<class_Color>` **outline_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LabelSettings_property_outline_color>`
- .. rst-class:: classref-property-setget
- - |void| **set_outline_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- - :ref:`Color<class_Color>` **get_outline_color**\ (\ )
- The color of the outline.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_outline_size:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_LabelSettings_property_outline_size>`
- .. rst-class:: classref-property-setget
- - |void| **set_outline_size**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_outline_size**\ (\ )
- Text outline size.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_paragraph_spacing:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **paragraph_spacing** = ``0.0`` :ref:`🔗<class_LabelSettings_property_paragraph_spacing>`
- .. rst-class:: classref-property-setget
- - |void| **set_paragraph_spacing**\ (\ value\: :ref:`float<class_float>`\ )
- - :ref:`float<class_float>` **get_paragraph_spacing**\ (\ )
- Vertical space between paragraphs. Added on top of :ref:`line_spacing<class_LabelSettings_property_line_spacing>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_shadow_color:
- .. rst-class:: classref-property
- :ref:`Color<class_Color>` **shadow_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_LabelSettings_property_shadow_color>`
- .. rst-class:: classref-property-setget
- - |void| **set_shadow_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- - :ref:`Color<class_Color>` **get_shadow_color**\ (\ )
- Color of the shadow effect. If alpha is ``0``, no shadow will be drawn.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_shadow_offset:
- .. rst-class:: classref-property
- :ref:`Vector2<class_Vector2>` **shadow_offset** = ``Vector2(1, 1)`` :ref:`🔗<class_LabelSettings_property_shadow_offset>`
- .. rst-class:: classref-property-setget
- - |void| **set_shadow_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- - :ref:`Vector2<class_Vector2>` **get_shadow_offset**\ (\ )
- Offset of the shadow effect, in pixels.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_shadow_size:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **shadow_size** = ``1`` :ref:`🔗<class_LabelSettings_property_shadow_size>`
- .. rst-class:: classref-property-setget
- - |void| **set_shadow_size**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_shadow_size**\ (\ )
- Size of the shadow effect.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_stacked_outline_count:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **stacked_outline_count** = ``0`` :ref:`🔗<class_LabelSettings_property_stacked_outline_count>`
- .. rst-class:: classref-property-setget
- - |void| **set_stacked_outline_count**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_stacked_outline_count**\ (\ )
- The number of stacked outlines.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_property_stacked_shadow_count:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **stacked_shadow_count** = ``0`` :ref:`🔗<class_LabelSettings_property_stacked_shadow_count>`
- .. rst-class:: classref-property-setget
- - |void| **set_stacked_shadow_count**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_stacked_shadow_count**\ (\ )
- The number of stacked shadows.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_LabelSettings_method_add_stacked_outline:
- .. rst-class:: classref-method
- |void| **add_stacked_outline**\ (\ index\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_LabelSettings_method_add_stacked_outline>`
- Adds a new stacked outline to the label at the given ``index``. If ``index`` is ``-1``, the new stacked outline will be added at the end of the list.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_add_stacked_shadow:
- .. rst-class:: classref-method
- |void| **add_stacked_shadow**\ (\ index\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_LabelSettings_method_add_stacked_shadow>`
- Adds a new stacked shadow to the label at the given ``index``. If ``index`` is ``-1``, the new stacked shadow will be added at the end of the list.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_get_stacked_outline_color:
- .. rst-class:: classref-method
- :ref:`Color<class_Color>` **get_stacked_outline_color**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LabelSettings_method_get_stacked_outline_color>`
- Returns the color of the stacked outline at ``index``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_get_stacked_outline_size:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_stacked_outline_size**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LabelSettings_method_get_stacked_outline_size>`
- Returns the size of the stacked outline at ``index``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_get_stacked_shadow_color:
- .. rst-class:: classref-method
- :ref:`Color<class_Color>` **get_stacked_shadow_color**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LabelSettings_method_get_stacked_shadow_color>`
- Returns the color of the stacked shadow at ``index``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_get_stacked_shadow_offset:
- .. rst-class:: classref-method
- :ref:`Vector2<class_Vector2>` **get_stacked_shadow_offset**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LabelSettings_method_get_stacked_shadow_offset>`
- Returns the offset of the stacked shadow at ``index``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_get_stacked_shadow_outline_size:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_stacked_shadow_outline_size**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LabelSettings_method_get_stacked_shadow_outline_size>`
- Returns the outline size of the stacked shadow at ``index``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_move_stacked_outline:
- .. rst-class:: classref-method
- |void| **move_stacked_outline**\ (\ from_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LabelSettings_method_move_stacked_outline>`
- Moves the stacked outline at index ``from_index`` to the given position ``to_position`` in the array.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_move_stacked_shadow:
- .. rst-class:: classref-method
- |void| **move_stacked_shadow**\ (\ from_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LabelSettings_method_move_stacked_shadow>`
- Moves the stacked shadow at index ``from_index`` to the given position ``to_position`` in the array.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_remove_stacked_outline:
- .. rst-class:: classref-method
- |void| **remove_stacked_outline**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LabelSettings_method_remove_stacked_outline>`
- Removes the stacked outline at index ``index``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_remove_stacked_shadow:
- .. rst-class:: classref-method
- |void| **remove_stacked_shadow**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LabelSettings_method_remove_stacked_shadow>`
- Removes the stacked shadow at index ``index``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_set_stacked_outline_color:
- .. rst-class:: classref-method
- |void| **set_stacked_outline_color**\ (\ index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_LabelSettings_method_set_stacked_outline_color>`
- Sets the color of the stacked outline identified by the given ``index`` to ``color``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_set_stacked_outline_size:
- .. rst-class:: classref-method
- |void| **set_stacked_outline_size**\ (\ index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LabelSettings_method_set_stacked_outline_size>`
- Sets the size of the stacked outline identified by the given ``index`` to ``size``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_set_stacked_shadow_color:
- .. rst-class:: classref-method
- |void| **set_stacked_shadow_color**\ (\ index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_LabelSettings_method_set_stacked_shadow_color>`
- Sets the color of the stacked shadow identified by the given ``index`` to ``color``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_set_stacked_shadow_offset:
- .. rst-class:: classref-method
- |void| **set_stacked_shadow_offset**\ (\ index\: :ref:`int<class_int>`, offset\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_LabelSettings_method_set_stacked_shadow_offset>`
- Sets the offset of the stacked shadow identified by the given ``index`` to ``offset``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_LabelSettings_method_set_stacked_shadow_outline_size:
- .. rst-class:: classref-method
- |void| **set_stacked_shadow_outline_size**\ (\ index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LabelSettings_method_set_stacked_shadow_outline_size>`
- Sets the outline size of the stacked shadow identified by the given ``index`` to ``size``.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|