2
0

StyleBoxTexture.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="StyleBoxTexture" inherits="StyleBox" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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. <argument index="0" name="margin" type="int" enum="Margin" />
  15. <description>
  16. Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
  17. </description>
  18. </method>
  19. <method name="get_margin_size" qualifiers="const">
  20. <return type="float" />
  21. <argument index="0" name="margin" type="int" enum="Margin" />
  22. <description>
  23. Returns the size of the given [code]margin[/code]. See [enum Margin] for possible values.
  24. </description>
  25. </method>
  26. <method name="set_expand_margin_all">
  27. <return type="void" />
  28. <argument index="0" name="size" type="float" />
  29. <description>
  30. Sets the expand margin to [code]size[/code] pixels for all margins.
  31. </description>
  32. </method>
  33. <method name="set_expand_margin_individual">
  34. <return type="void" />
  35. <argument index="0" name="size_left" type="float" />
  36. <argument index="1" name="size_top" type="float" />
  37. <argument index="2" name="size_right" type="float" />
  38. <argument index="3" name="size_bottom" type="float" />
  39. <description>
  40. 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.
  41. </description>
  42. </method>
  43. <method name="set_expand_margin_size">
  44. <return type="void" />
  45. <argument index="0" name="margin" type="int" enum="Margin" />
  46. <argument index="1" name="size" type="float" />
  47. <description>
  48. Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
  49. </description>
  50. </method>
  51. <method name="set_margin_size">
  52. <return type="void" />
  53. <argument index="0" name="margin" type="int" enum="Margin" />
  54. <argument index="1" name="size" type="float" />
  55. <description>
  56. Sets the margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
  57. </description>
  58. </method>
  59. </methods>
  60. <members>
  61. <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
  62. Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values.
  63. </member>
  64. <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
  65. Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values.
  66. </member>
  67. <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true">
  68. If [code]true[/code], the nine-patch texture's center tile will be drawn.
  69. </member>
  70. <member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  71. Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
  72. </member>
  73. <member name="expand_margin_left" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  74. Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.
  75. </member>
  76. <member name="expand_margin_right" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  77. Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.
  78. </member>
  79. <member name="expand_margin_top" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
  80. Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.
  81. </member>
  82. <member name="margin_bottom" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  83. Increases the bottom margin of the 3×3 texture box.
  84. A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box.
  85. This is also the value used as fallback for [member StyleBox.content_margin_bottom] if it is negative.
  86. </member>
  87. <member name="margin_left" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  88. Increases the left margin of the 3×3 texture box.
  89. A higher value means more of the source texture is considered to be part of the left border of the 3×3 box.
  90. This is also the value used as fallback for [member StyleBox.content_margin_left] if it is negative.
  91. </member>
  92. <member name="margin_right" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  93. Increases the right margin of the 3×3 texture box.
  94. A higher value means more of the source texture is considered to be part of the right border of the 3×3 box.
  95. This is also the value used as fallback for [member StyleBox.content_margin_right] if it is negative.
  96. </member>
  97. <member name="margin_top" type="float" setter="set_margin_size" getter="get_margin_size" default="0.0">
  98. Increases the top margin of the 3×3 texture box.
  99. A higher value means more of the source texture is considered to be part of the top border of the 3×3 box.
  100. This is also the value used as fallback for [member StyleBox.content_margin_top] if it is negative.
  101. </member>
  102. <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )">
  103. Modulates the color of the texture when this style box is drawn.
  104. </member>
  105. <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map">
  106. The normal map to use when drawing this style box.
  107. [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.
  108. </member>
  109. <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
  110. Species a sub-region of the texture to use.
  111. This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
  112. </member>
  113. <member name="texture" type="Texture" setter="set_texture" getter="get_texture">
  114. The texture to use when drawing this style box.
  115. </member>
  116. </members>
  117. <signals>
  118. <signal name="texture_changed">
  119. <description>
  120. Emitted when the stylebox's texture is changed.
  121. </description>
  122. </signal>
  123. </signals>
  124. <constants>
  125. <constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode">
  126. Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly.
  127. </constant>
  128. <constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode">
  129. Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system.
  130. </constant>
  131. <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode">
  132. 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.
  133. </constant>
  134. </constants>
  135. </class>