Rect2.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Rect2" category="Built-In Types" version="3.1">
  3. <brief_description>
  4. 2D Axis-aligned bounding box.
  5. </brief_description>
  6. <description>
  7. Rect2 consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="Rect2">
  16. <return type="Rect2">
  17. </return>
  18. <argument index="0" name="position" type="Vector2">
  19. </argument>
  20. <argument index="1" name="size" type="Vector2">
  21. </argument>
  22. <description>
  23. Constructs a [code]Rect2[/code] by position and size.
  24. </description>
  25. </method>
  26. <method name="Rect2">
  27. <return type="Rect2">
  28. </return>
  29. <argument index="0" name="x" type="float">
  30. </argument>
  31. <argument index="1" name="y" type="float">
  32. </argument>
  33. <argument index="2" name="width" type="float">
  34. </argument>
  35. <argument index="3" name="height" type="float">
  36. </argument>
  37. <description>
  38. Constructs a [code]Rect2[/code] by x, y, width, and height.
  39. </description>
  40. </method>
  41. <method name="abs">
  42. <return type="Rect2">
  43. </return>
  44. <description>
  45. Returns a [code]Rect2[/code] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive.
  46. </description>
  47. </method>
  48. <method name="clip">
  49. <return type="Rect2">
  50. </return>
  51. <argument index="0" name="b" type="Rect2">
  52. </argument>
  53. <description>
  54. Returns the intersection of this [code]Rect2[/code] and b.
  55. </description>
  56. </method>
  57. <method name="encloses">
  58. <return type="bool">
  59. </return>
  60. <argument index="0" name="b" type="Rect2">
  61. </argument>
  62. <description>
  63. Returns [code]true[/code] if this [code]Rect2[/code] completely encloses another one.
  64. </description>
  65. </method>
  66. <method name="expand">
  67. <return type="Rect2">
  68. </return>
  69. <argument index="0" name="to" type="Vector2">
  70. </argument>
  71. <description>
  72. Returns this [code]Rect2[/code] expanded to include a given point.
  73. </description>
  74. </method>
  75. <method name="get_area">
  76. <return type="float">
  77. </return>
  78. <description>
  79. Returns the area of the [code]Rect2[/code].
  80. </description>
  81. </method>
  82. <method name="grow">
  83. <return type="Rect2">
  84. </return>
  85. <argument index="0" name="by" type="float">
  86. </argument>
  87. <description>
  88. Returns a copy of the [code]Rect2[/code] grown a given amount of units towards all the sides.
  89. </description>
  90. </method>
  91. <method name="grow_individual">
  92. <return type="Rect2">
  93. </return>
  94. <argument index="0" name="left" type="float">
  95. </argument>
  96. <argument index="1" name="top" type="float">
  97. </argument>
  98. <argument index="2" name="right" type="float">
  99. </argument>
  100. <argument index="3" name=" bottom" type="float">
  101. </argument>
  102. <description>
  103. Returns a copy of the [code]Rect2[/code] grown a given amount of units towards each direction individually.
  104. </description>
  105. </method>
  106. <method name="grow_margin">
  107. <return type="Rect2">
  108. </return>
  109. <argument index="0" name="margin" type="int">
  110. </argument>
  111. <argument index="1" name="by" type="float">
  112. </argument>
  113. <description>
  114. Returns a copy of the [code]Rect2[/code] grown a given amount of units towards the [enum Margin] direction.
  115. </description>
  116. </method>
  117. <method name="has_no_area">
  118. <return type="bool">
  119. </return>
  120. <description>
  121. Returns [code]true[/code] if the [code]Rect2[/code] is flat or empty.
  122. </description>
  123. </method>
  124. <method name="has_point">
  125. <return type="bool">
  126. </return>
  127. <argument index="0" name="point" type="Vector2">
  128. </argument>
  129. <description>
  130. Returns [code]true[/code] if the [code]Rect2[/code] contains a point.
  131. </description>
  132. </method>
  133. <method name="intersects">
  134. <return type="bool">
  135. </return>
  136. <argument index="0" name="b" type="Rect2">
  137. </argument>
  138. <description>
  139. Returns [code]true[/code] if the [code]Rect2[/code] overlaps with another.
  140. </description>
  141. </method>
  142. <method name="merge">
  143. <return type="Rect2">
  144. </return>
  145. <argument index="0" name="b" type="Rect2">
  146. </argument>
  147. <description>
  148. Returns a larger Rect2 that contains this Rect2 and [code]with[/code].
  149. </description>
  150. </method>
  151. </methods>
  152. <members>
  153. <member name="end" type="Vector2" setter="" getter="">
  154. Ending corner.
  155. </member>
  156. <member name="position" type="Vector2" setter="" getter="">
  157. Position (starting corner).
  158. </member>
  159. <member name="size" type="Vector2" setter="" getter="">
  160. Size from position to end.
  161. </member>
  162. </members>
  163. <constants>
  164. </constants>
  165. </class>