NinePatchRect.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="NinePatchRect" inherits="Control" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes.
  5. </brief_description>
  6. <description>
  7. Better known as 9-slice panels, NinePatchRect produces clean panels of any size, based on a small texture. To do so, it splits the texture in a 3 by 3 grid. When you scale the node, it tiles the texture's sides horizontally or vertically, the center on both axes but it doesn't scale or tile the corners.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="get_h_axis_stretch_mode" qualifiers="const">
  15. <return type="int" enum="NinePatchRect.AxisStretchMode">
  16. </return>
  17. <description>
  18. </description>
  19. </method>
  20. <method name="get_patch_margin" qualifiers="const">
  21. <return type="int">
  22. </return>
  23. <argument index="0" name="margin" type="int" enum="Margin">
  24. </argument>
  25. <description>
  26. </description>
  27. </method>
  28. <method name="get_region_rect" qualifiers="const">
  29. <return type="Rect2">
  30. </return>
  31. <description>
  32. </description>
  33. </method>
  34. <method name="get_texture" qualifiers="const">
  35. <return type="Texture">
  36. </return>
  37. <description>
  38. </description>
  39. </method>
  40. <method name="get_v_axis_stretch_mode" qualifiers="const">
  41. <return type="int" enum="NinePatchRect.AxisStretchMode">
  42. </return>
  43. <description>
  44. </description>
  45. </method>
  46. <method name="is_draw_center_enabled" qualifiers="const">
  47. <return type="bool">
  48. </return>
  49. <description>
  50. </description>
  51. </method>
  52. <method name="set_draw_center">
  53. <return type="void">
  54. </return>
  55. <argument index="0" name="draw_center" type="bool">
  56. </argument>
  57. <description>
  58. </description>
  59. </method>
  60. <method name="set_h_axis_stretch_mode">
  61. <return type="void">
  62. </return>
  63. <argument index="0" name="mode" type="int" enum="NinePatchRect.AxisStretchMode">
  64. </argument>
  65. <description>
  66. </description>
  67. </method>
  68. <method name="set_patch_margin">
  69. <return type="void">
  70. </return>
  71. <argument index="0" name="margin" type="int" enum="Margin">
  72. </argument>
  73. <argument index="1" name="value" type="int">
  74. </argument>
  75. <description>
  76. </description>
  77. </method>
  78. <method name="set_region_rect">
  79. <return type="void">
  80. </return>
  81. <argument index="0" name="rect" type="Rect2">
  82. </argument>
  83. <description>
  84. </description>
  85. </method>
  86. <method name="set_texture">
  87. <return type="void">
  88. </return>
  89. <argument index="0" name="texture" type="Texture">
  90. </argument>
  91. <description>
  92. </description>
  93. </method>
  94. <method name="set_v_axis_stretch_mode">
  95. <return type="void">
  96. </return>
  97. <argument index="0" name="mode" type="int" enum="NinePatchRect.AxisStretchMode">
  98. </argument>
  99. <description>
  100. </description>
  101. </method>
  102. </methods>
  103. <members>
  104. <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode">
  105. Doesn't do anything at the time of writing.
  106. </member>
  107. <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode">
  108. Doesn't do anything at the time of writing.
  109. </member>
  110. <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled">
  111. If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders. Default value: [code]true[/code]
  112. </member>
  113. <member name="patch_margin_bottom" type="int" setter="set_patch_margin" getter="get_patch_margin">
  114. The height of the 9-slice'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.
  115. </member>
  116. <member name="patch_margin_left" type="int" setter="set_patch_margin" getter="get_patch_margin">
  117. The height of the 9-slice's left column.
  118. </member>
  119. <member name="patch_margin_right" type="int" setter="set_patch_margin" getter="get_patch_margin">
  120. The height of the 9-slice's right column.
  121. </member>
  122. <member name="patch_margin_top" type="int" setter="set_patch_margin" getter="get_patch_margin">
  123. The height of the 9-slice's top row.
  124. </member>
  125. <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect">
  126. Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one.
  127. </member>
  128. <member name="texture" type="Texture" setter="set_texture" getter="get_texture">
  129. The node's texture resource.
  130. </member>
  131. </members>
  132. <signals>
  133. <signal name="texture_changed">
  134. <description>
  135. Fired when the node's texture changes.
  136. </description>
  137. </signal>
  138. </signals>
  139. <constants>
  140. <constant name="AXIS_STRETCH_MODE_STRETCH" value="0">
  141. Doesn't do anything at the time of writing. Default value for [code]axis_stretch_horizontal[/code] and [code]axis_stretch_vertical[/code].
  142. </constant>
  143. <constant name="AXIS_STRETCH_MODE_TILE" value="1">
  144. Doesn't do anything at the time of writing.
  145. </constant>
  146. <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2">
  147. Doesn't do anything at the time of writing.
  148. </constant>
  149. </constants>
  150. </class>