class_styleboxtexture.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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 StyleBoxTexture.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_StyleBoxTexture:
  6. StyleBoxTexture
  7. ===============
  8. **Inherits:** :ref:`StyleBox<class_StyleBox>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Texture Based 3x3 scale style.
  13. Properties
  14. ----------
  15. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  16. | :ref:`AxisStretchMode<enum_StyleBoxTexture_AxisStretchMode>` | :ref:`axis_stretch_horizontal<class_StyleBoxTexture_property_axis_stretch_horizontal>` |
  17. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  18. | :ref:`AxisStretchMode<enum_StyleBoxTexture_AxisStretchMode>` | :ref:`axis_stretch_vertical<class_StyleBoxTexture_property_axis_stretch_vertical>` |
  19. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`draw_center<class_StyleBoxTexture_property_draw_center>` |
  21. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`expand_margin_bottom<class_StyleBoxTexture_property_expand_margin_bottom>` |
  23. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`expand_margin_left<class_StyleBoxTexture_property_expand_margin_left>` |
  25. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`expand_margin_right<class_StyleBoxTexture_property_expand_margin_right>` |
  27. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`expand_margin_top<class_StyleBoxTexture_property_expand_margin_top>` |
  29. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`margin_bottom<class_StyleBoxTexture_property_margin_bottom>` |
  31. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`margin_left<class_StyleBoxTexture_property_margin_left>` |
  33. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`margin_right<class_StyleBoxTexture_property_margin_right>` |
  35. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`margin_top<class_StyleBoxTexture_property_margin_top>` |
  37. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  38. | :ref:`Color<class_Color>` | :ref:`modulate_color<class_StyleBoxTexture_property_modulate_color>` |
  39. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  40. | :ref:`Texture<class_Texture>` | :ref:`normal_map<class_StyleBoxTexture_property_normal_map>` |
  41. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  42. | :ref:`Rect2<class_Rect2>` | :ref:`region_rect<class_StyleBoxTexture_property_region_rect>` |
  43. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  44. | :ref:`Texture<class_Texture>` | :ref:`texture<class_StyleBoxTexture_property_texture>` |
  45. +--------------------------------------------------------------+----------------------------------------------------------------------------------------+
  46. Methods
  47. -------
  48. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`set_expand_margin_all<class_StyleBoxTexture_method_set_expand_margin_all>` **(** :ref:`float<class_float>` size **)** |
  50. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`set_expand_margin_individual<class_StyleBoxTexture_method_set_expand_margin_individual>` **(** :ref:`float<class_float>` size_left, :ref:`float<class_float>` size_top, :ref:`float<class_float>` size_right, :ref:`float<class_float>` size_bottom **)** |
  52. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. Signals
  54. -------
  55. .. _class_StyleBoxTexture_signal_texture_changed:
  56. - **texture_changed** **(** **)**
  57. Enumerations
  58. ------------
  59. .. _enum_StyleBoxTexture_AxisStretchMode:
  60. .. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_STRETCH:
  61. .. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_TILE:
  62. .. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_TILE_FIT:
  63. enum **AxisStretchMode**:
  64. - **AXIS_STRETCH_MODE_STRETCH** = **0**
  65. - **AXIS_STRETCH_MODE_TILE** = **1**
  66. - **AXIS_STRETCH_MODE_TILE_FIT** = **2**
  67. Description
  68. -----------
  69. Texture Based 3x3 scale style. This stylebox performs a 3x3 scaling of a texture, where only the center cell is fully stretched. This allows for the easy creation of bordered styles.
  70. Property Descriptions
  71. ---------------------
  72. .. _class_StyleBoxTexture_property_axis_stretch_horizontal:
  73. - :ref:`AxisStretchMode<enum_StyleBoxTexture_AxisStretchMode>` **axis_stretch_horizontal**
  74. +----------+--------------------------------+
  75. | *Setter* | set_h_axis_stretch_mode(value) |
  76. +----------+--------------------------------+
  77. | *Getter* | get_h_axis_stretch_mode() |
  78. +----------+--------------------------------+
  79. ----
  80. .. _class_StyleBoxTexture_property_axis_stretch_vertical:
  81. - :ref:`AxisStretchMode<enum_StyleBoxTexture_AxisStretchMode>` **axis_stretch_vertical**
  82. +----------+--------------------------------+
  83. | *Setter* | set_v_axis_stretch_mode(value) |
  84. +----------+--------------------------------+
  85. | *Getter* | get_v_axis_stretch_mode() |
  86. +----------+--------------------------------+
  87. ----
  88. .. _class_StyleBoxTexture_property_draw_center:
  89. - :ref:`bool<class_bool>` **draw_center**
  90. +----------+--------------------------+
  91. | *Setter* | set_draw_center(value) |
  92. +----------+--------------------------+
  93. | *Getter* | is_draw_center_enabled() |
  94. +----------+--------------------------+
  95. ----
  96. .. _class_StyleBoxTexture_property_expand_margin_bottom:
  97. - :ref:`float<class_float>` **expand_margin_bottom**
  98. +----------+-------------------------------+
  99. | *Setter* | set_expand_margin_size(value) |
  100. +----------+-------------------------------+
  101. | *Getter* | get_expand_margin_size() |
  102. +----------+-------------------------------+
  103. Expands the bottom margin of this style box when drawing, causing it be drawn larger than requested.
  104. ----
  105. .. _class_StyleBoxTexture_property_expand_margin_left:
  106. - :ref:`float<class_float>` **expand_margin_left**
  107. +----------+-------------------------------+
  108. | *Setter* | set_expand_margin_size(value) |
  109. +----------+-------------------------------+
  110. | *Getter* | get_expand_margin_size() |
  111. +----------+-------------------------------+
  112. Expands the left margin of this style box when drawing, causing it be drawn larger than requested.
  113. ----
  114. .. _class_StyleBoxTexture_property_expand_margin_right:
  115. - :ref:`float<class_float>` **expand_margin_right**
  116. +----------+-------------------------------+
  117. | *Setter* | set_expand_margin_size(value) |
  118. +----------+-------------------------------+
  119. | *Getter* | get_expand_margin_size() |
  120. +----------+-------------------------------+
  121. Expands the right margin of this style box when drawing, causing it be drawn larger than requested.
  122. ----
  123. .. _class_StyleBoxTexture_property_expand_margin_top:
  124. - :ref:`float<class_float>` **expand_margin_top**
  125. +----------+-------------------------------+
  126. | *Setter* | set_expand_margin_size(value) |
  127. +----------+-------------------------------+
  128. | *Getter* | get_expand_margin_size() |
  129. +----------+-------------------------------+
  130. Expands the top margin of this style box when drawing, causing it be drawn larger than requested.
  131. ----
  132. .. _class_StyleBoxTexture_property_margin_bottom:
  133. - :ref:`float<class_float>` **margin_bottom**
  134. +----------+------------------------+
  135. | *Setter* | set_margin_size(value) |
  136. +----------+------------------------+
  137. | *Getter* | get_margin_size() |
  138. +----------+------------------------+
  139. Increases the bottom margin of the 3x3 texture box.
  140. A higher value means more of the source texture is considered to be part of the bottom border of the 3x3 box.
  141. This is also the value used as fallback for :ref:`StyleBox.content_margin_bottom<class_StyleBox_property_content_margin_bottom>` if it is negative.
  142. ----
  143. .. _class_StyleBoxTexture_property_margin_left:
  144. - :ref:`float<class_float>` **margin_left**
  145. +----------+------------------------+
  146. | *Setter* | set_margin_size(value) |
  147. +----------+------------------------+
  148. | *Getter* | get_margin_size() |
  149. +----------+------------------------+
  150. Increases the left margin of the 3x3 texture box.
  151. A higher value means more of the source texture is considered to be part of the left border of the 3x3 box.
  152. This is also the value used as fallback for :ref:`StyleBox.content_margin_left<class_StyleBox_property_content_margin_left>` if it is negative.
  153. ----
  154. .. _class_StyleBoxTexture_property_margin_right:
  155. - :ref:`float<class_float>` **margin_right**
  156. +----------+------------------------+
  157. | *Setter* | set_margin_size(value) |
  158. +----------+------------------------+
  159. | *Getter* | get_margin_size() |
  160. +----------+------------------------+
  161. Increases the right margin of the 3x3 texture box.
  162. A higher value means more of the source texture is considered to be part of the right border of the 3x3 box.
  163. This is also the value used as fallback for :ref:`StyleBox.content_margin_right<class_StyleBox_property_content_margin_right>` if it is negative.
  164. ----
  165. .. _class_StyleBoxTexture_property_margin_top:
  166. - :ref:`float<class_float>` **margin_top**
  167. +----------+------------------------+
  168. | *Setter* | set_margin_size(value) |
  169. +----------+------------------------+
  170. | *Getter* | get_margin_size() |
  171. +----------+------------------------+
  172. Increases the top margin of the 3x3 texture box.
  173. A higher value means more of the source texture is considered to be part of the top border of the 3x3 box.
  174. This is also the value used as fallback for :ref:`StyleBox.content_margin_top<class_StyleBox_property_content_margin_top>` if it is negative.
  175. ----
  176. .. _class_StyleBoxTexture_property_modulate_color:
  177. - :ref:`Color<class_Color>` **modulate_color**
  178. +----------+---------------------+
  179. | *Setter* | set_modulate(value) |
  180. +----------+---------------------+
  181. | *Getter* | get_modulate() |
  182. +----------+---------------------+
  183. Modulates the color of the texture when this style box is drawn.
  184. ----
  185. .. _class_StyleBoxTexture_property_normal_map:
  186. - :ref:`Texture<class_Texture>` **normal_map**
  187. +----------+-----------------------+
  188. | *Setter* | set_normal_map(value) |
  189. +----------+-----------------------+
  190. | *Getter* | get_normal_map() |
  191. +----------+-----------------------+
  192. The normal map to use when drawing this style box.
  193. ----
  194. .. _class_StyleBoxTexture_property_region_rect:
  195. - :ref:`Rect2<class_Rect2>` **region_rect**
  196. +----------+------------------------+
  197. | *Setter* | set_region_rect(value) |
  198. +----------+------------------------+
  199. | *Getter* | get_region_rect() |
  200. +----------+------------------------+
  201. Species a sub region of the texture to use.
  202. This is equivalent to first wrapping the texture in an :ref:`AtlasTexture<class_AtlasTexture>` with the same region.
  203. ----
  204. .. _class_StyleBoxTexture_property_texture:
  205. - :ref:`Texture<class_Texture>` **texture**
  206. +----------+--------------------+
  207. | *Setter* | set_texture(value) |
  208. +----------+--------------------+
  209. | *Getter* | get_texture() |
  210. +----------+--------------------+
  211. The texture to use when drawing this style box.
  212. Method Descriptions
  213. -------------------
  214. .. _class_StyleBoxTexture_method_set_expand_margin_all:
  215. - void **set_expand_margin_all** **(** :ref:`float<class_float>` size **)**
  216. ----
  217. .. _class_StyleBoxTexture_method_set_expand_margin_individual:
  218. - void **set_expand_margin_individual** **(** :ref:`float<class_float>` size_left, :ref:`float<class_float>` size_top, :ref:`float<class_float>` size_right, :ref:`float<class_float>` size_bottom **)**