StyleBoxFlat.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.1">
  3. <brief_description>
  4. Customizable Stylebox with a given set of parameters. (no texture required)
  5. </brief_description>
  6. <description>
  7. This stylebox can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable:
  8. - Color
  9. - Border width (individual width for each border)
  10. - Rounded corners (individual radius for each corner)
  11. - Shadow
  12. Setting corner radius to high values is allowed. As soon as corners would overlap the stylebox will switch to a relative system. Example:
  13. [codeblock]
  14. height = 30
  15. corner_radius_top_left = 50
  16. corner_radius_bottom_left = 100
  17. [/codeblock]
  18. The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will [b]never[/b] be more than the height. Result:
  19. [codeblock]
  20. corner_radius_top_left: 10
  21. corner_radius_bottom_left: 20
  22. [/codeblock]
  23. </description>
  24. <tutorials>
  25. </tutorials>
  26. <demos>
  27. </demos>
  28. <methods>
  29. <method name="get_border_width_min" qualifiers="const">
  30. <return type="int">
  31. </return>
  32. <description>
  33. </description>
  34. </method>
  35. <method name="set_border_width_all">
  36. <return type="void">
  37. </return>
  38. <argument index="0" name="width" type="int">
  39. </argument>
  40. <description>
  41. </description>
  42. </method>
  43. <method name="set_corner_radius_all">
  44. <return type="void">
  45. </return>
  46. <argument index="0" name="radius" type="int">
  47. </argument>
  48. <description>
  49. </description>
  50. </method>
  51. <method name="set_corner_radius_individual">
  52. <return type="void">
  53. </return>
  54. <argument index="0" name="radius_top_left" type="int">
  55. </argument>
  56. <argument index="1" name="radius_top_right" type="int">
  57. </argument>
  58. <argument index="2" name="radius_bottom_right" type="int">
  59. </argument>
  60. <argument index="3" name="radius_bottom_left" type="int">
  61. </argument>
  62. <description>
  63. </description>
  64. </method>
  65. <method name="set_expand_margin_all">
  66. <return type="void">
  67. </return>
  68. <argument index="0" name="size" type="float">
  69. </argument>
  70. <description>
  71. </description>
  72. </method>
  73. <method name="set_expand_margin_individual">
  74. <return type="void">
  75. </return>
  76. <argument index="0" name="size_left" type="float">
  77. </argument>
  78. <argument index="1" name="size_top" type="float">
  79. </argument>
  80. <argument index="2" name="size_right" type="float">
  81. </argument>
  82. <argument index="3" name="size_bottom" type="float">
  83. </argument>
  84. <description>
  85. </description>
  86. </method>
  87. </methods>
  88. <members>
  89. <member name="anti_aliasing" type="bool" setter="set_anti_aliased" getter="is_anti_aliased">
  90. Anti Aliasing draws a small ring around edges. This ring fades to transparent. As a result edges look much smoother. This is only noticeable when using rounded corners.
  91. </member>
  92. <member name="anti_aliasing_size" type="int" setter="set_aa_size" getter="get_aa_size">
  93. This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect.
  94. </member>
  95. <member name="bg_color" type="Color" setter="set_bg_color" getter="get_bg_color">
  96. The background color of the stylebox.
  97. </member>
  98. <member name="border_blend" type="bool" setter="set_border_blend" getter="get_border_blend">
  99. When set to true, the border will fade into the background color.
  100. </member>
  101. <member name="border_color" type="Color" setter="set_border_color" getter="get_border_color">
  102. Sets the color of the border.
  103. </member>
  104. <member name="border_width_bottom" type="int" setter="set_border_width" getter="get_border_width">
  105. Border width for the bottom border.
  106. </member>
  107. <member name="border_width_left" type="int" setter="set_border_width" getter="get_border_width">
  108. Border width for the left border.
  109. </member>
  110. <member name="border_width_right" type="int" setter="set_border_width" getter="get_border_width">
  111. Border width for the right border.
  112. </member>
  113. <member name="border_width_top" type="int" setter="set_border_width" getter="get_border_width">
  114. Border width for the top border.
  115. </member>
  116. <member name="corner_detail" type="int" setter="set_corner_detail" getter="get_corner_detail">
  117. This sets the amount of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value you should take the corner radius ([method set_corner_radius_all]) into account.
  118. For corner radius smaller than 10, 4-5 should be enough.
  119. For corner radius smaller than 30, 8-12 should be enough.
  120. </member>
  121. <member name="corner_radius_bottom_left" type="int" setter="set_corner_radius" getter="get_corner_radius">
  122. The corner radius of the bottom left corner. When set to 0 the corner is not rounded.
  123. </member>
  124. <member name="corner_radius_bottom_right" type="int" setter="set_corner_radius" getter="get_corner_radius">
  125. The corner radius of the bottom right corner. When set to 0 the corner is not rounded.
  126. </member>
  127. <member name="corner_radius_top_left" type="int" setter="set_corner_radius" getter="get_corner_radius">
  128. The corner radius of the top left corner. When set to 0 the corner is not rounded.
  129. </member>
  130. <member name="corner_radius_top_right" type="int" setter="set_corner_radius" getter="get_corner_radius">
  131. The corner radius of the top right corner. When set to 0 the corner is not rounded.
  132. </member>
  133. <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled">
  134. Toggels drawing of the inner part of the stylebox.
  135. </member>
  136. <member name="expand_margin_bottom" type="float" setter="set_expand_margin" getter="get_expand_margin">
  137. Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with border_width_bottom. To draw a border outside the control rect.
  138. </member>
  139. <member name="expand_margin_left" type="float" setter="set_expand_margin" getter="get_expand_margin">
  140. Expands the stylebox outside of the control rect on the left edge. Useful in combination with border_width_left. To draw a border outside the control rect.
  141. </member>
  142. <member name="expand_margin_right" type="float" setter="set_expand_margin" getter="get_expand_margin">
  143. Expands the stylebox outside of the control rect on the right edge. Useful in combination with border_width_right. To draw a border outside the control rect.
  144. </member>
  145. <member name="expand_margin_top" type="float" setter="set_expand_margin" getter="get_expand_margin">
  146. Expands the stylebox outside of the control rect on the top edge. Useful in combination with border_width_top. To draw a border outside the control rect.
  147. </member>
  148. <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color">
  149. The color of the shadow. (This has no effect when shadow_size &lt; 1)
  150. </member>
  151. <member name="shadow_size" type="int" setter="set_shadow_size" getter="get_shadow_size">
  152. The shadow size in pixels.
  153. </member>
  154. </members>
  155. <constants>
  156. </constants>
  157. </class>