class_progressbar.rst 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/ProgressBar.xml.
  6. .. _class_ProgressBar:
  7. ProgressBar
  8. ===========
  9. **Inherits:** :ref:`Range<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A control used for visual representation of a percentage.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A control used for visual representation of a percentage. Shows fill percentage from right to left.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-------------------------+--------------------------------------------------------------------+----------+
  21. | :ref:`int<class_int>` | :ref:`fill_mode<class_ProgressBar_property_fill_mode>` | ``0`` |
  22. +-------------------------+--------------------------------------------------------------------+----------+
  23. | :ref:`bool<class_bool>` | :ref:`show_percentage<class_ProgressBar_property_show_percentage>` | ``true`` |
  24. +-------------------------+--------------------------------------------------------------------+----------+
  25. .. rst-class:: classref-reftable-group
  26. Theme Properties
  27. ----------------
  28. .. table::
  29. :widths: auto
  30. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  31. | :ref:`Color<class_Color>` | :ref:`font_color<class_ProgressBar_theme_color_font_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  32. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  33. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_ProgressBar_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  34. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  35. | :ref:`Color<class_Color>` | :ref:`font_shadow_color<class_ProgressBar_theme_color_font_shadow_color>` | ``Color(0, 0, 0, 1)`` |
  36. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  37. | :ref:`int<class_int>` | :ref:`outline_size<class_ProgressBar_theme_constant_outline_size>` | ``0`` |
  38. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  39. | :ref:`Font<class_Font>` | :ref:`font<class_ProgressBar_theme_font_font>` | |
  40. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  41. | :ref:`int<class_int>` | :ref:`font_size<class_ProgressBar_theme_font_size_font_size>` | |
  42. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  43. | :ref:`StyleBox<class_StyleBox>` | :ref:`background<class_ProgressBar_theme_style_background>` | |
  44. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  45. | :ref:`StyleBox<class_StyleBox>` | :ref:`fill<class_ProgressBar_theme_style_fill>` | |
  46. +---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Enumerations
  51. ------------
  52. .. _enum_ProgressBar_FillMode:
  53. .. rst-class:: classref-enumeration
  54. enum **FillMode**:
  55. .. _class_ProgressBar_constant_FILL_BEGIN_TO_END:
  56. .. rst-class:: classref-enumeration-constant
  57. :ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_BEGIN_TO_END** = ``0``
  58. The progress bar fills from begin to end horizontally, according to the language direction. If :ref:`Control.is_layout_rtl<class_Control_method_is_layout_rtl>` returns ``false``, it fills from left to right, and if it returns ``true``, it fills from right to left.
  59. .. _class_ProgressBar_constant_FILL_END_TO_BEGIN:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_END_TO_BEGIN** = ``1``
  62. The progress bar fills from end to begin horizontally, according to the language direction. If :ref:`Control.is_layout_rtl<class_Control_method_is_layout_rtl>` returns ``false``, it fills from right to left, and if it returns ``true``, it fills from left to right.
  63. .. _class_ProgressBar_constant_FILL_TOP_TO_BOTTOM:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_TOP_TO_BOTTOM** = ``2``
  66. The progress fills from top to bottom.
  67. .. _class_ProgressBar_constant_FILL_BOTTOM_TO_TOP:
  68. .. rst-class:: classref-enumeration-constant
  69. :ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_BOTTOM_TO_TOP** = ``3``
  70. The progress fills from bottom to top.
  71. .. rst-class:: classref-section-separator
  72. ----
  73. .. rst-class:: classref-descriptions-group
  74. Property Descriptions
  75. ---------------------
  76. .. _class_ProgressBar_property_fill_mode:
  77. .. rst-class:: classref-property
  78. :ref:`int<class_int>` **fill_mode** = ``0``
  79. .. rst-class:: classref-property-setget
  80. - void **set_fill_mode** **(** :ref:`int<class_int>` value **)**
  81. - :ref:`int<class_int>` **get_fill_mode** **(** **)**
  82. The fill direction. See :ref:`FillMode<enum_ProgressBar_FillMode>` for possible values.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_ProgressBar_property_show_percentage:
  86. .. rst-class:: classref-property
  87. :ref:`bool<class_bool>` **show_percentage** = ``true``
  88. .. rst-class:: classref-property-setget
  89. - void **set_show_percentage** **(** :ref:`bool<class_bool>` value **)**
  90. - :ref:`bool<class_bool>` **is_percentage_shown** **(** **)**
  91. If ``true``, the fill percentage is displayed on the bar.
  92. .. rst-class:: classref-section-separator
  93. ----
  94. .. rst-class:: classref-descriptions-group
  95. Theme Property Descriptions
  96. ---------------------------
  97. .. _class_ProgressBar_theme_color_font_color:
  98. .. rst-class:: classref-themeproperty
  99. :ref:`Color<class_Color>` **font_color** = ``Color(0.95, 0.95, 0.95, 1)``
  100. The color of the text.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_ProgressBar_theme_color_font_outline_color:
  104. .. rst-class:: classref-themeproperty
  105. :ref:`Color<class_Color>` **font_outline_color** = ``Color(1, 1, 1, 1)``
  106. The tint of text outline of the **ProgressBar**.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_ProgressBar_theme_color_font_shadow_color:
  110. .. rst-class:: classref-themeproperty
  111. :ref:`Color<class_Color>` **font_shadow_color** = ``Color(0, 0, 0, 1)``
  112. The color of the text's shadow.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_ProgressBar_theme_constant_outline_size:
  116. .. rst-class:: classref-themeproperty
  117. :ref:`int<class_int>` **outline_size** = ``0``
  118. The size of the text outline.
  119. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_ProgressBar_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_ProgressBar_theme_font_font:
  123. .. rst-class:: classref-themeproperty
  124. :ref:`Font<class_Font>` **font**
  125. Font used to draw the fill percentage if :ref:`show_percentage<class_ProgressBar_property_show_percentage>` is ``true``.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_ProgressBar_theme_font_size_font_size:
  129. .. rst-class:: classref-themeproperty
  130. :ref:`int<class_int>` **font_size**
  131. Font size used to draw the fill percentage if :ref:`show_percentage<class_ProgressBar_property_show_percentage>` is ``true``.
  132. .. rst-class:: classref-item-separator
  133. ----
  134. .. _class_ProgressBar_theme_style_background:
  135. .. rst-class:: classref-themeproperty
  136. :ref:`StyleBox<class_StyleBox>` **background**
  137. The style of the background.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_ProgressBar_theme_style_fill:
  141. .. rst-class:: classref-themeproperty
  142. :ref:`StyleBox<class_StyleBox>` **fill**
  143. The style of the progress (i.e. the part that fills the bar).
  144. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  145. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  146. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  147. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  148. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  149. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`