class_labelsettings.rst 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. Collection of common settings to customize label text.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **LabelSettings** is a resource that can be assigned to a :ref:`Label<class_Label>` node to customize it. It will take priority over the properties defined in theme. The resource can be shared between multiple labels and swapped 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:`Color<class_Color>` | :ref:`shadow_color<class_LabelSettings_property_shadow_color>` | ``Color(0, 0, 0, 0)`` |
  34. +-------------------------------+------------------------------------------------------------------+-----------------------+
  35. | :ref:`Vector2<class_Vector2>` | :ref:`shadow_offset<class_LabelSettings_property_shadow_offset>` | ``Vector2(1, 1)`` |
  36. +-------------------------------+------------------------------------------------------------------+-----------------------+
  37. | :ref:`int<class_int>` | :ref:`shadow_size<class_LabelSettings_property_shadow_size>` | ``1`` |
  38. +-------------------------------+------------------------------------------------------------------+-----------------------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Property Descriptions
  43. ---------------------
  44. .. _class_LabelSettings_property_font:
  45. .. rst-class:: classref-property
  46. :ref:`Font<class_Font>` **font**
  47. .. rst-class:: classref-property-setget
  48. - void **set_font** **(** :ref:`Font<class_Font>` value **)**
  49. - :ref:`Font<class_Font>` **get_font** **(** **)**
  50. :ref:`Font<class_Font>` used for the text.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_LabelSettings_property_font_color:
  54. .. rst-class:: classref-property
  55. :ref:`Color<class_Color>` **font_color** = ``Color(1, 1, 1, 1)``
  56. .. rst-class:: classref-property-setget
  57. - void **set_font_color** **(** :ref:`Color<class_Color>` value **)**
  58. - :ref:`Color<class_Color>` **get_font_color** **(** **)**
  59. Color of the text.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_LabelSettings_property_font_size:
  63. .. rst-class:: classref-property
  64. :ref:`int<class_int>` **font_size** = ``16``
  65. .. rst-class:: classref-property-setget
  66. - void **set_font_size** **(** :ref:`int<class_int>` value **)**
  67. - :ref:`int<class_int>` **get_font_size** **(** **)**
  68. Size of the text.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_LabelSettings_property_line_spacing:
  72. .. rst-class:: classref-property
  73. :ref:`float<class_float>` **line_spacing** = ``3.0``
  74. .. rst-class:: classref-property-setget
  75. - void **set_line_spacing** **(** :ref:`float<class_float>` value **)**
  76. - :ref:`float<class_float>` **get_line_spacing** **(** **)**
  77. Vertical space between lines when the text is multiline.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_LabelSettings_property_outline_color:
  81. .. rst-class:: classref-property
  82. :ref:`Color<class_Color>` **outline_color** = ``Color(1, 1, 1, 1)``
  83. .. rst-class:: classref-property-setget
  84. - void **set_outline_color** **(** :ref:`Color<class_Color>` value **)**
  85. - :ref:`Color<class_Color>` **get_outline_color** **(** **)**
  86. The color of the outline.
  87. .. rst-class:: classref-item-separator
  88. ----
  89. .. _class_LabelSettings_property_outline_size:
  90. .. rst-class:: classref-property
  91. :ref:`int<class_int>` **outline_size** = ``0``
  92. .. rst-class:: classref-property-setget
  93. - void **set_outline_size** **(** :ref:`int<class_int>` value **)**
  94. - :ref:`int<class_int>` **get_outline_size** **(** **)**
  95. Text outline size.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_LabelSettings_property_shadow_color:
  99. .. rst-class:: classref-property
  100. :ref:`Color<class_Color>` **shadow_color** = ``Color(0, 0, 0, 0)``
  101. .. rst-class:: classref-property-setget
  102. - void **set_shadow_color** **(** :ref:`Color<class_Color>` value **)**
  103. - :ref:`Color<class_Color>` **get_shadow_color** **(** **)**
  104. Color of the shadow effect. If alpha is ``0``, no shadow will be drawn.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_LabelSettings_property_shadow_offset:
  108. .. rst-class:: classref-property
  109. :ref:`Vector2<class_Vector2>` **shadow_offset** = ``Vector2(1, 1)``
  110. .. rst-class:: classref-property-setget
  111. - void **set_shadow_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  112. - :ref:`Vector2<class_Vector2>` **get_shadow_offset** **(** **)**
  113. Offset of the shadow effect, in pixels.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_LabelSettings_property_shadow_size:
  117. .. rst-class:: classref-property
  118. :ref:`int<class_int>` **shadow_size** = ``1``
  119. .. rst-class:: classref-property-setget
  120. - void **set_shadow_size** **(** :ref:`int<class_int>` value **)**
  121. - :ref:`int<class_int>` **get_shadow_size** **(** **)**
  122. Size of the shadow effect.
  123. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  124. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  125. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  126. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  127. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  128. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`