: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` **<** :ref:`RefCounted` **<** :ref:`Object` Provides common settings to customize the text in a :ref:`Label`. .. rst-class:: classref-introduction-group Description ----------- **LabelSettings** is a resource that provides common settings to customize the text in a :ref:`Label`. It will take priority over the properties defined in :ref:`Control.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` | :ref:`font` | | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`Color` | :ref:`font_color` | ``Color(1, 1, 1, 1)`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`int` | :ref:`font_size` | ``16`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`line_spacing` | ``3.0`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`Color` | :ref:`outline_color` | ``Color(1, 1, 1, 1)`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`int` | :ref:`outline_size` | ``0`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`paragraph_spacing` | ``0.0`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`Color` | :ref:`shadow_color` | ``Color(0, 0, 0, 0)`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`Vector2` | :ref:`shadow_offset` | ``Vector2(1, 1)`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`int` | :ref:`shadow_size` | ``1`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`int` | :ref:`stacked_outline_count` | ``0`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ | :ref:`int` | :ref:`stacked_shadow_count` | ``0`` | +-------------------------------+----------------------------------------------------------------------------------+-----------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_stacked_outline`\ (\ index\: :ref:`int` = -1\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_stacked_shadow`\ (\ index\: :ref:`int` = -1\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_stacked_outline_color`\ (\ index\: :ref:`int`\ ) |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_stacked_outline_size`\ (\ index\: :ref:`int`\ ) |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_stacked_shadow_color`\ (\ index\: :ref:`int`\ ) |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_stacked_shadow_offset`\ (\ index\: :ref:`int`\ ) |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_stacked_shadow_outline_size`\ (\ index\: :ref:`int`\ ) |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`move_stacked_outline`\ (\ from_index\: :ref:`int`, to_position\: :ref:`int`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`move_stacked_shadow`\ (\ from_index\: :ref:`int`, to_position\: :ref:`int`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_stacked_outline`\ (\ index\: :ref:`int`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_stacked_shadow`\ (\ index\: :ref:`int`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_stacked_outline_color`\ (\ index\: :ref:`int`, color\: :ref:`Color`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_stacked_outline_size`\ (\ index\: :ref:`int`, size\: :ref:`int`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_stacked_shadow_color`\ (\ index\: :ref:`int`, color\: :ref:`Color`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_stacked_shadow_offset`\ (\ index\: :ref:`int`, offset\: :ref:`Vector2`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_stacked_shadow_outline_size`\ (\ index\: :ref:`int`, size\: :ref:`int`\ ) | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_LabelSettings_property_font: .. rst-class:: classref-property :ref:`Font` **font** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_font**\ (\ value\: :ref:`Font`\ ) - :ref:`Font` **get_font**\ (\ ) :ref:`Font` used for the text. .. rst-class:: classref-item-separator ---- .. _class_LabelSettings_property_font_color: .. rst-class:: classref-property :ref:`Color` **font_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_font_color**\ (\ value\: :ref:`Color`\ ) - :ref:`Color` **get_font_color**\ (\ ) Color of the text. .. rst-class:: classref-item-separator ---- .. _class_LabelSettings_property_font_size: .. rst-class:: classref-property :ref:`int` **font_size** = ``16`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_font_size**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_font_size**\ (\ ) Size of the text. .. rst-class:: classref-item-separator ---- .. _class_LabelSettings_property_line_spacing: .. rst-class:: classref-property :ref:`float` **line_spacing** = ``3.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_line_spacing**\ (\ value\: :ref:`float`\ ) - :ref:`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` **outline_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_outline_color**\ (\ value\: :ref:`Color`\ ) - :ref:`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` **outline_size** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_outline_size**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_outline_size**\ (\ ) Text outline size. .. rst-class:: classref-item-separator ---- .. _class_LabelSettings_property_paragraph_spacing: .. rst-class:: classref-property :ref:`float` **paragraph_spacing** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_paragraph_spacing**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_paragraph_spacing**\ (\ ) Vertical space between paragraphs. Added on top of :ref:`line_spacing`. .. rst-class:: classref-item-separator ---- .. _class_LabelSettings_property_shadow_color: .. rst-class:: classref-property :ref:`Color` **shadow_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_shadow_color**\ (\ value\: :ref:`Color`\ ) - :ref:`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` **shadow_offset** = ``Vector2(1, 1)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_shadow_offset**\ (\ value\: :ref:`Vector2`\ ) - :ref:`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` **shadow_size** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_shadow_size**\ (\ value\: :ref:`int`\ ) - :ref:`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` **stacked_outline_count** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_stacked_outline_count**\ (\ value\: :ref:`int`\ ) - :ref:`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` **stacked_shadow_count** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_stacked_shadow_count**\ (\ value\: :ref:`int`\ ) - :ref:`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` = -1\ ) :ref:`🔗` 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` = -1\ ) :ref:`🔗` 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` **get_stacked_outline_color**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` 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` **get_stacked_outline_size**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` 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` **get_stacked_shadow_color**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` 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` **get_stacked_shadow_offset**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` 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` **get_stacked_shadow_outline_size**\ (\ index\: :ref:`int`\ ) |const| :ref:`🔗` 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`, to_position\: :ref:`int`\ ) :ref:`🔗` 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`, to_position\: :ref:`int`\ ) :ref:`🔗` 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`\ ) :ref:`🔗` 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`\ ) :ref:`🔗` 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`, color\: :ref:`Color`\ ) :ref:`🔗` 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`, size\: :ref:`int`\ ) :ref:`🔗` 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`, color\: :ref:`Color`\ ) :ref:`🔗` 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`, offset\: :ref:`Vector2`\ ) :ref:`🔗` 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`, size\: :ref:`int`\ ) :ref:`🔗` 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.)`