StyleBoxTexture.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="StyleBoxTexture" inherits="StyleBox" version="3.3">
  3. <brief_description>
  4. Texture-based nine-patch [StyleBox].
  5. </brief_description>
  6. <description>
  7. Texture-based nine-patch [StyleBox], in a way similar to [NinePatchRect]. This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="get_expand_margin_size" qualifiers="const">
  13. <return type="float">
  14. </return>
  15. <argument index="0" name="margin" type="int" enum="Margin">
  16. </argument>
  17. <description>
  18. Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
  19. </description>
  20. </method>
  21. <method name="get_margin_size" qualifiers="const">
  22. <return type="float">
  23. </return>
  24. <argument index="0" name="margin" type="int" enum="Margin">
  25. </argument>
  26. <description>
  27. Returns the size of the given [code]margin[/code]. See [enum Margin] for possible values.
  28. </description>
  29. </method>
  30. <method name="set_expand_margin_all">
  31. <return type="void">
  32. </return>
  33. <argument index="0" name="size" type="float">
  34. </argument>
  35. <description>
  36. Sets the expand margin to [code]size[/code] pixels for all margins.
  37. </description>
  38. </method>
  39. <method name="set_expand_margin_individual">
  40. <return type="void">
  41. </return>
  42. <argument index="0" name="size_left" type="float">
  43. </argument>
  44. <argument index="1" name="size_top" type="float">
  45. </argument>
  46. <argument index="2" name="size_right" type="float">
  47. </argument>
  48. <argument index="3" name="size_bottom" type="float">
  49. </argument>
  50. <description>
  51. Sets the expand margin for each margin to [code]size_left[/code], [code]size_top[/code], [code]size_right[/code], and [code]size_bottom[/code] pixels.
  52. </description>
  53. </method>
  54. <method name="set_expand_margin_size">
  55. <return type="void">
  56. </return>
  57. <argument index="0" name="margin" type="int" enum="Margin">
  58. </argument>
  59. <argument index="1" name="size" type="float">
  60. </argument>
  61. <description>
  62. Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
  63. </description>
  64. </method>
  65. <method name="set_margin_size">
  66. <return type="void">
  67. </return>
  68. <argument index="0" name="margin" type="int" enum="Margin">
  69. </argument>
  70. <argument index="1" name="size" type="float">
  71. </argument>
  72. <description>
  73. Sets the margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
  74. </description>
  75. </method>
  76. </methods>
  77. <members>
  78. <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
  79. Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values.
  80. </member>
  81. <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
  82. Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values.
  83. </member>
  84. <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true">
  85. If [code]true[/code], the nine-patch texture's center tile will be drawn.
  86. </member>
  87. <member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  88. Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
  89. </member>
  90. <member name="expand_margin_left" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  91. Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.
  92. </member>
  93. <member name="expand_margin_right" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  94. Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.
  95. </member>
  96. <member name="expand_margin_top" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  97. Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.
  98. </member>
  99. <member name="margin_bottom" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  100. Increases the bottom margin of the 3×3 texture box.
  101. A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box.
  102. This is also the value used as fallback for [member StyleBox.content_margin_bottom] if it is negative.
  103. </member>
  104. <member name="margin_left" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  105. Increases the left margin of the 3×3 texture box.
  106. A higher value means more of the source texture is considered to be part of the left border of the 3×3 box.
  107. This is also the value used as fallback for [member StyleBox.content_margin_left] if it is negative.
  108. </member>
  109. <member name="margin_right" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  110. Increases the right margin of the 3×3 texture box.
  111. A higher value means more of the source texture is considered to be part of the right border of the 3×3 box.
  112. This is also the value used as fallback for [member StyleBox.content_margin_right] if it is negative.
  113. </member>
  114. <member name="margin_top" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  115. Increases the top margin of the 3×3 texture box.
  116. A higher value means more of the source texture is considered to be part of the top border of the 3×3 box.
  117. This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative.
  118. </member>
  119. <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )">
  120. Modulates the color of the texture when this style box is drawn.
  121. </member>
  122. <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map">
  123. The normal map to use when drawing this style box.
  124. [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
  125. </member>
  126. <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
  127. Species a sub-region of the texture to use.
  128. This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
  129. </member>
  130. <member name="texture" type="Texture" setter="set_texture" getter="get_texture">
  131. The texture to use when drawing this style box.
  132. </member>
  133. </members>
  134. <signals>
  135. <signal name="texture_changed">
  136. <description>
  137. Emitted when the stylebox's texture is changed.
  138. </description>
  139. </signal>
  140. </signals>
  141. <constants>
  142. <constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode">
  143. Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly.
  144. </constant>
  145. <constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode">
  146. Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system.
  147. </constant>
  148. <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode">
  149. Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike [constant AXIS_STRETCH_MODE_TILE], the texture may be slightly stretched to make the nine-patch texture tile seamlessly.
  150. </constant>
  151. </constants>
  152. </class>