class_labelsettings.rst 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/LabelSettings.xml.
  6. .. _class_LabelSettings:
  7. LabelSettings
  8. =============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Provides common settings to customize the text in a :ref:`Label<class_Label>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **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.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  21. | :ref:`Font<class_Font>` | :ref:`font<class_LabelSettings_property_font>` | |
  22. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  23. | :ref:`Color<class_Color>` | :ref:`font_color<class_LabelSettings_property_font_color>` | ``Color(1, 1, 1, 1)`` |
  24. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  25. | :ref:`int<class_int>` | :ref:`font_size<class_LabelSettings_property_font_size>` | ``16`` |
  26. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  27. | :ref:`float<class_float>` | :ref:`line_spacing<class_LabelSettings_property_line_spacing>` | ``3.0`` |
  28. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  29. | :ref:`Color<class_Color>` | :ref:`outline_color<class_LabelSettings_property_outline_color>` | ``Color(1, 1, 1, 1)`` |
  30. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  31. | :ref:`int<class_int>` | :ref:`outline_size<class_LabelSettings_property_outline_size>` | ``0`` |
  32. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  33. | :ref:`float<class_float>` | :ref:`paragraph_spacing<class_LabelSettings_property_paragraph_spacing>` | ``0.0`` |
  34. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  35. | :ref:`Color<class_Color>` | :ref:`shadow_color<class_LabelSettings_property_shadow_color>` | ``Color(0, 0, 0, 0)`` |
  36. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  37. | :ref:`Vector2<class_Vector2>` | :ref:`shadow_offset<class_LabelSettings_property_shadow_offset>` | ``Vector2(1, 1)`` |
  38. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  39. | :ref:`int<class_int>` | :ref:`shadow_size<class_LabelSettings_property_shadow_size>` | ``1`` |
  40. +-------------------------------+--------------------------------------------------------------------------+-----------------------+
  41. .. rst-class:: classref-section-separator
  42. ----
  43. .. rst-class:: classref-descriptions-group
  44. Property Descriptions
  45. ---------------------
  46. .. _class_LabelSettings_property_font:
  47. .. rst-class:: classref-property
  48. :ref:`Font<class_Font>` **font** :ref:`🔗<class_LabelSettings_property_font>`
  49. .. rst-class:: classref-property-setget
  50. - |void| **set_font**\ (\ value\: :ref:`Font<class_Font>`\ )
  51. - :ref:`Font<class_Font>` **get_font**\ (\ )
  52. :ref:`Font<class_Font>` used for the text.
  53. .. rst-class:: classref-item-separator
  54. ----
  55. .. _class_LabelSettings_property_font_color:
  56. .. rst-class:: classref-property
  57. :ref:`Color<class_Color>` **font_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LabelSettings_property_font_color>`
  58. .. rst-class:: classref-property-setget
  59. - |void| **set_font_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  60. - :ref:`Color<class_Color>` **get_font_color**\ (\ )
  61. Color of the text.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_LabelSettings_property_font_size:
  65. .. rst-class:: classref-property
  66. :ref:`int<class_int>` **font_size** = ``16`` :ref:`🔗<class_LabelSettings_property_font_size>`
  67. .. rst-class:: classref-property-setget
  68. - |void| **set_font_size**\ (\ value\: :ref:`int<class_int>`\ )
  69. - :ref:`int<class_int>` **get_font_size**\ (\ )
  70. Size of the text.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_LabelSettings_property_line_spacing:
  74. .. rst-class:: classref-property
  75. :ref:`float<class_float>` **line_spacing** = ``3.0`` :ref:`🔗<class_LabelSettings_property_line_spacing>`
  76. .. rst-class:: classref-property-setget
  77. - |void| **set_line_spacing**\ (\ value\: :ref:`float<class_float>`\ )
  78. - :ref:`float<class_float>` **get_line_spacing**\ (\ )
  79. Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_LabelSettings_property_outline_color:
  83. .. rst-class:: classref-property
  84. :ref:`Color<class_Color>` **outline_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LabelSettings_property_outline_color>`
  85. .. rst-class:: classref-property-setget
  86. - |void| **set_outline_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  87. - :ref:`Color<class_Color>` **get_outline_color**\ (\ )
  88. The color of the outline.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_LabelSettings_property_outline_size:
  92. .. rst-class:: classref-property
  93. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_LabelSettings_property_outline_size>`
  94. .. rst-class:: classref-property-setget
  95. - |void| **set_outline_size**\ (\ value\: :ref:`int<class_int>`\ )
  96. - :ref:`int<class_int>` **get_outline_size**\ (\ )
  97. Text outline size.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_LabelSettings_property_paragraph_spacing:
  101. .. rst-class:: classref-property
  102. :ref:`float<class_float>` **paragraph_spacing** = ``0.0`` :ref:`🔗<class_LabelSettings_property_paragraph_spacing>`
  103. .. rst-class:: classref-property-setget
  104. - |void| **set_paragraph_spacing**\ (\ value\: :ref:`float<class_float>`\ )
  105. - :ref:`float<class_float>` **get_paragraph_spacing**\ (\ )
  106. Vertical space between paragraphs. Added on top of :ref:`line_spacing<class_LabelSettings_property_line_spacing>`.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_LabelSettings_property_shadow_color:
  110. .. rst-class:: classref-property
  111. :ref:`Color<class_Color>` **shadow_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_LabelSettings_property_shadow_color>`
  112. .. rst-class:: classref-property-setget
  113. - |void| **set_shadow_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  114. - :ref:`Color<class_Color>` **get_shadow_color**\ (\ )
  115. Color of the shadow effect. If alpha is ``0``, no shadow will be drawn.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_LabelSettings_property_shadow_offset:
  119. .. rst-class:: classref-property
  120. :ref:`Vector2<class_Vector2>` **shadow_offset** = ``Vector2(1, 1)`` :ref:`🔗<class_LabelSettings_property_shadow_offset>`
  121. .. rst-class:: classref-property-setget
  122. - |void| **set_shadow_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  123. - :ref:`Vector2<class_Vector2>` **get_shadow_offset**\ (\ )
  124. Offset of the shadow effect, in pixels.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_LabelSettings_property_shadow_size:
  128. .. rst-class:: classref-property
  129. :ref:`int<class_int>` **shadow_size** = ``1`` :ref:`🔗<class_LabelSettings_property_shadow_size>`
  130. .. rst-class:: classref-property-setget
  131. - |void| **set_shadow_size**\ (\ value\: :ref:`int<class_int>`\ )
  132. - :ref:`int<class_int>` **get_shadow_size**\ (\ )
  133. Size of the shadow effect.
  134. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  135. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  136. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  137. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  138. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  139. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  140. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  141. .. |void| replace:: :abbr:`void (No return value.)`