class_textureprogress.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the TextureProgress.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_TextureProgress:
  6. TextureProgress
  7. ===============
  8. **Inherits:** :ref:`Range<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Texture-based progress bar. Useful for loading screens and life or stamina bars.
  13. Properties
  14. ----------
  15. +-------------------------------+------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`fill_mode<class_TextureProgress_property_fill_mode>` |
  17. +-------------------------------+------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`nine_patch_stretch<class_TextureProgress_property_nine_patch_stretch>` |
  19. +-------------------------------+------------------------------------------------------------------------------------+
  20. | :ref:`Vector2<class_Vector2>` | :ref:`radial_center_offset<class_TextureProgress_property_radial_center_offset>` |
  21. +-------------------------------+------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`radial_fill_degrees<class_TextureProgress_property_radial_fill_degrees>` |
  23. +-------------------------------+------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`radial_initial_angle<class_TextureProgress_property_radial_initial_angle>` |
  25. +-------------------------------+------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`stretch_margin_bottom<class_TextureProgress_property_stretch_margin_bottom>` |
  27. +-------------------------------+------------------------------------------------------------------------------------+
  28. | :ref:`int<class_int>` | :ref:`stretch_margin_left<class_TextureProgress_property_stretch_margin_left>` |
  29. +-------------------------------+------------------------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`stretch_margin_right<class_TextureProgress_property_stretch_margin_right>` |
  31. +-------------------------------+------------------------------------------------------------------------------------+
  32. | :ref:`int<class_int>` | :ref:`stretch_margin_top<class_TextureProgress_property_stretch_margin_top>` |
  33. +-------------------------------+------------------------------------------------------------------------------------+
  34. | :ref:`Texture<class_Texture>` | :ref:`texture_over<class_TextureProgress_property_texture_over>` |
  35. +-------------------------------+------------------------------------------------------------------------------------+
  36. | :ref:`Texture<class_Texture>` | :ref:`texture_progress<class_TextureProgress_property_texture_progress>` |
  37. +-------------------------------+------------------------------------------------------------------------------------+
  38. | :ref:`Texture<class_Texture>` | :ref:`texture_under<class_TextureProgress_property_texture_under>` |
  39. +-------------------------------+------------------------------------------------------------------------------------+
  40. | :ref:`Color<class_Color>` | :ref:`tint_over<class_TextureProgress_property_tint_over>` |
  41. +-------------------------------+------------------------------------------------------------------------------------+
  42. | :ref:`Color<class_Color>` | :ref:`tint_progress<class_TextureProgress_property_tint_progress>` |
  43. +-------------------------------+------------------------------------------------------------------------------------+
  44. | :ref:`Color<class_Color>` | :ref:`tint_under<class_TextureProgress_property_tint_under>` |
  45. +-------------------------------+------------------------------------------------------------------------------------+
  46. Enumerations
  47. ------------
  48. .. _enum_TextureProgress_FillMode:
  49. .. _class_TextureProgress_constant_FILL_LEFT_TO_RIGHT:
  50. .. _class_TextureProgress_constant_FILL_RIGHT_TO_LEFT:
  51. .. _class_TextureProgress_constant_FILL_TOP_TO_BOTTOM:
  52. .. _class_TextureProgress_constant_FILL_BOTTOM_TO_TOP:
  53. .. _class_TextureProgress_constant_FILL_CLOCKWISE:
  54. .. _class_TextureProgress_constant_FILL_COUNTER_CLOCKWISE:
  55. .. _class_TextureProgress_constant_FILL_BILINEAR_LEFT_AND_RIGHT:
  56. .. _class_TextureProgress_constant_FILL_BILINEAR_TOP_AND_BOTTOM:
  57. .. _class_TextureProgress_constant_FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE:
  58. enum **FillMode**:
  59. - **FILL_LEFT_TO_RIGHT** = **0** --- The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills from left to right.
  60. - **FILL_RIGHT_TO_LEFT** = **1** --- The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills from right to left.
  61. - **FILL_TOP_TO_BOTTOM** = **2** --- The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills from top to bototm.
  62. - **FILL_BOTTOM_TO_TOP** = **3** --- The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills from bottom to top.
  63. - **FILL_CLOCKWISE** = **4** --- Turns the node into a radial bar. The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills clockwise. See :ref:`radial_center_offset<class_TextureProgress_property_radial_center_offset>`, :ref:`radial_initial_angle<class_TextureProgress_property_radial_initial_angle>` and :ref:`radial_fill_degrees<class_TextureProgress_property_radial_fill_degrees>` to control the way the bar fills up.
  64. - **FILL_COUNTER_CLOCKWISE** = **5** --- Turns the node into a radial bar. The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills counter-clockwise. See :ref:`radial_center_offset<class_TextureProgress_property_radial_center_offset>`, :ref:`radial_initial_angle<class_TextureProgress_property_radial_initial_angle>` and :ref:`radial_fill_degrees<class_TextureProgress_property_radial_fill_degrees>` to control the way the bar fills up.
  65. - **FILL_BILINEAR_LEFT_AND_RIGHT** = **6** --- The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills from the center, expanding both towards the left and the right.
  66. - **FILL_BILINEAR_TOP_AND_BOTTOM** = **7** --- The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills from the center, expanding both towards the top and the bottom.
  67. - **FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE** = **8** --- Turns the node into a radial bar. The :ref:`texture_progress<class_TextureProgress_property_texture_progress>` fills radially from the center, expanding both clockwise and counter-clockwise. See :ref:`radial_center_offset<class_TextureProgress_property_radial_center_offset>`, :ref:`radial_initial_angle<class_TextureProgress_property_radial_initial_angle>` and :ref:`radial_fill_degrees<class_TextureProgress_property_radial_fill_degrees>` to control the way the bar fills up.
  68. Description
  69. -----------
  70. TextureProgress works like :ref:`ProgressBar<class_ProgressBar>` but it uses up to 3 textures instead of Godot's :ref:`Theme<class_Theme>` resource. Works horizontally, vertically, and radially.
  71. Property Descriptions
  72. ---------------------
  73. .. _class_TextureProgress_property_fill_mode:
  74. - :ref:`int<class_int>` **fill_mode**
  75. +----------+----------------------+
  76. | *Setter* | set_fill_mode(value) |
  77. +----------+----------------------+
  78. | *Getter* | get_fill_mode() |
  79. +----------+----------------------+
  80. The fill direction. Uses FILL\_\* constants.
  81. ----
  82. .. _class_TextureProgress_property_nine_patch_stretch:
  83. - :ref:`bool<class_bool>` **nine_patch_stretch**
  84. +----------+-------------------------------+
  85. | *Setter* | set_nine_patch_stretch(value) |
  86. +----------+-------------------------------+
  87. | *Getter* | get_nine_patch_stretch() |
  88. +----------+-------------------------------+
  89. If ``true``, Godot treats the bar's textures like :ref:`NinePatchRect<class_NinePatchRect>`. Use ``stretch_margin_*``, like :ref:`stretch_margin_bottom<class_TextureProgress_property_stretch_margin_bottom>`, to set up the nine patch's 3x3 grid. Default value: ``false``.
  90. ----
  91. .. _class_TextureProgress_property_radial_center_offset:
  92. - :ref:`Vector2<class_Vector2>` **radial_center_offset**
  93. +----------+---------------------------------+
  94. | *Setter* | set_radial_center_offset(value) |
  95. +----------+---------------------------------+
  96. | *Getter* | get_radial_center_offset() |
  97. +----------+---------------------------------+
  98. Offsets :ref:`texture_progress<class_TextureProgress_property_texture_progress>` if :ref:`fill_mode<class_TextureProgress_property_fill_mode>` is :ref:`FILL_CLOCKWISE<class_TextureProgress_constant_FILL_CLOCKWISE>` or :ref:`FILL_COUNTER_CLOCKWISE<class_TextureProgress_constant_FILL_COUNTER_CLOCKWISE>`.
  99. ----
  100. .. _class_TextureProgress_property_radial_fill_degrees:
  101. - :ref:`float<class_float>` **radial_fill_degrees**
  102. +----------+-------------------------+
  103. | *Setter* | set_fill_degrees(value) |
  104. +----------+-------------------------+
  105. | *Getter* | get_fill_degrees() |
  106. +----------+-------------------------+
  107. Upper limit for the fill of :ref:`texture_progress<class_TextureProgress_property_texture_progress>` if :ref:`fill_mode<class_TextureProgress_property_fill_mode>` is :ref:`FILL_CLOCKWISE<class_TextureProgress_constant_FILL_CLOCKWISE>` or :ref:`FILL_COUNTER_CLOCKWISE<class_TextureProgress_constant_FILL_COUNTER_CLOCKWISE>`. When the node's ``value`` is equal to its ``max_value``, the texture fills up to this angle.
  108. See :ref:`Range.value<class_Range_property_value>`, :ref:`Range.max_value<class_Range_property_max_value>`.
  109. ----
  110. .. _class_TextureProgress_property_radial_initial_angle:
  111. - :ref:`float<class_float>` **radial_initial_angle**
  112. +----------+---------------------------------+
  113. | *Setter* | set_radial_initial_angle(value) |
  114. +----------+---------------------------------+
  115. | *Getter* | get_radial_initial_angle() |
  116. +----------+---------------------------------+
  117. Starting angle for the fill of :ref:`texture_progress<class_TextureProgress_property_texture_progress>` if :ref:`fill_mode<class_TextureProgress_property_fill_mode>` is :ref:`FILL_CLOCKWISE<class_TextureProgress_constant_FILL_CLOCKWISE>` or :ref:`FILL_COUNTER_CLOCKWISE<class_TextureProgress_constant_FILL_COUNTER_CLOCKWISE>`. When the node's ``value`` is equal to its ``min_value``, the texture doesn't show up at all. When the ``value`` increases, the texture fills and tends towards :ref:`radial_fill_degrees<class_TextureProgress_property_radial_fill_degrees>`.
  118. ----
  119. .. _class_TextureProgress_property_stretch_margin_bottom:
  120. - :ref:`int<class_int>` **stretch_margin_bottom**
  121. +----------+---------------------------+
  122. | *Setter* | set_stretch_margin(value) |
  123. +----------+---------------------------+
  124. | *Getter* | get_stretch_margin() |
  125. +----------+---------------------------+
  126. The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
  127. ----
  128. .. _class_TextureProgress_property_stretch_margin_left:
  129. - :ref:`int<class_int>` **stretch_margin_left**
  130. +----------+---------------------------+
  131. | *Setter* | set_stretch_margin(value) |
  132. +----------+---------------------------+
  133. | *Getter* | get_stretch_margin() |
  134. +----------+---------------------------+
  135. The width of the 9-patch's left column.
  136. ----
  137. .. _class_TextureProgress_property_stretch_margin_right:
  138. - :ref:`int<class_int>` **stretch_margin_right**
  139. +----------+---------------------------+
  140. | *Setter* | set_stretch_margin(value) |
  141. +----------+---------------------------+
  142. | *Getter* | get_stretch_margin() |
  143. +----------+---------------------------+
  144. The width of the 9-patch's right column.
  145. ----
  146. .. _class_TextureProgress_property_stretch_margin_top:
  147. - :ref:`int<class_int>` **stretch_margin_top**
  148. +----------+---------------------------+
  149. | *Setter* | set_stretch_margin(value) |
  150. +----------+---------------------------+
  151. | *Getter* | get_stretch_margin() |
  152. +----------+---------------------------+
  153. The height of the 9-patch's top row.
  154. ----
  155. .. _class_TextureProgress_property_texture_over:
  156. - :ref:`Texture<class_Texture>` **texture_over**
  157. +----------+-------------------------+
  158. | *Setter* | set_over_texture(value) |
  159. +----------+-------------------------+
  160. | *Getter* | get_over_texture() |
  161. +----------+-------------------------+
  162. :ref:`Texture<class_Texture>` that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of :ref:`texture_progress<class_TextureProgress_property_texture_progress>`.
  163. ----
  164. .. _class_TextureProgress_property_texture_progress:
  165. - :ref:`Texture<class_Texture>` **texture_progress**
  166. +----------+-----------------------------+
  167. | *Setter* | set_progress_texture(value) |
  168. +----------+-----------------------------+
  169. | *Getter* | get_progress_texture() |
  170. +----------+-----------------------------+
  171. :ref:`Texture<class_Texture>` that clips based on the node's ``value`` and :ref:`fill_mode<class_TextureProgress_property_fill_mode>`. As ``value`` increased, the texture fills up. It shows entirely when ``value`` reaches ``max_value``. It doesn't show at all if ``value`` is equal to ``min_value``.
  172. The ``value`` property comes from :ref:`Range<class_Range>`. See :ref:`Range.value<class_Range_property_value>`, :ref:`Range.min_value<class_Range_property_min_value>`, :ref:`Range.max_value<class_Range_property_max_value>`.
  173. ----
  174. .. _class_TextureProgress_property_texture_under:
  175. - :ref:`Texture<class_Texture>` **texture_under**
  176. +----------+--------------------------+
  177. | *Setter* | set_under_texture(value) |
  178. +----------+--------------------------+
  179. | *Getter* | get_under_texture() |
  180. +----------+--------------------------+
  181. :ref:`Texture<class_Texture>` that draws under the progress bar. The bar's background.
  182. ----
  183. .. _class_TextureProgress_property_tint_over:
  184. - :ref:`Color<class_Color>` **tint_over**
  185. +----------+----------------------+
  186. | *Setter* | set_tint_over(value) |
  187. +----------+----------------------+
  188. | *Getter* | get_tint_over() |
  189. +----------+----------------------+
  190. Multiplies the color of the bar's ``texture_over`` texture. The effect is similar to :ref:`CanvasItem.modulate<class_CanvasItem_property_modulate>`, except it only affects this specific texture instead of the entire node.
  191. ----
  192. .. _class_TextureProgress_property_tint_progress:
  193. - :ref:`Color<class_Color>` **tint_progress**
  194. +----------+--------------------------+
  195. | *Setter* | set_tint_progress(value) |
  196. +----------+--------------------------+
  197. | *Getter* | get_tint_progress() |
  198. +----------+--------------------------+
  199. Multiplies the color of the bar's ``texture_progress`` texture.
  200. ----
  201. .. _class_TextureProgress_property_tint_under:
  202. - :ref:`Color<class_Color>` **tint_under**
  203. +----------+-----------------------+
  204. | *Setter* | set_tint_under(value) |
  205. +----------+-----------------------+
  206. | *Getter* | get_tint_under() |
  207. +----------+-----------------------+
  208. Multiplies the color of the bar's ``texture_under`` texture.