Rect2 provides an 2D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<methodname="Rect2">
<returntype="Rect2">
</return>
<argumentindex="0"name="pos"type="Vector2">
</argument>
<argumentindex="1"name="size"type="Vector2">
</argument>
<description>
Construct a [Rect2] by position and size.
</description>
</method>
<methodname="Rect2">
<returntype="Rect2">
</return>
<argumentindex="0"name="x"type="float">
</argument>
<argumentindex="1"name="y"type="float">
</argument>
<argumentindex="2"name="width"type="float">
</argument>
<argumentindex="3"name="height"type="float">
</argument>
<description>
Construct a [Rect2] by x, y, width and height.
</description>
</method>
<methodname="clip">
<returntype="Rect2">
</return>
<argumentindex="0"name="b"type="Rect2">
</argument>
<description>
Returns the intersection of this [Rect2] and b.
</description>
</method>
<methodname="encloses">
<returntype="bool">
</return>
<argumentindex="0"name="b"type="Rect2">
</argument>
<description>
Returns true if this [Rect2] completely encloses another one.
</description>
</method>
<methodname="expand">
<returntype="Rect2">
</return>
<argumentindex="0"name="to"type="Vector2">
</argument>
<description>
Return this [Rect2] expanded to include a given point.
</description>
</method>
<methodname="get_area">
<returntype="float">
</return>
<description>
Get the area of the [Rect2].
</description>
</method>
<methodname="grow">
<returntype="Rect2">
</return>
<argumentindex="0"name="by"type="float">
</argument>
<description>
Return a copy of the [Rect2] grown a given amount of units towards all the sides.
</description>
</method>
<methodname="grow_individual">
<returntype="Rect2">
</return>
<argumentindex="0"name="left"type="float">
</argument>
<argumentindex="1"name="top"type="float">
</argument>
<argumentindex="2"name="right"type="float">
</argument>
<argumentindex="3"name=" bottom"type="float">
</argument>
<description>
</description>
</method>
<methodname="grow_margin">
<returntype="Rect2">
</return>
<argumentindex="0"name="margin"type="int">
</argument>
<argumentindex="1"name="by"type="float">
</argument>
<description>
</description>
</method>
<methodname="has_no_area">
<returntype="bool">
</return>
<description>
Return true if the [Rect2] is flat or empty.
</description>
</method>
<methodname="has_point">
<returntype="bool">
</return>
<argumentindex="0"name="point"type="Vector2">
</argument>
<description>
Return true if the [Rect2] contains a point.
</description>
</method>
<methodname="intersects">
<returntype="bool">
</return>
<argumentindex="0"name="b"type="Rect2">
</argument>
<description>
Return true if the [Rect2] overlaps with another.
</description>
</method>
<methodname="merge">
<returntype="Rect2">
</return>
<argumentindex="0"name="b"type="Rect2">
</argument>
<description>
Combine this [Rect2] with another, a larger one is returned that contains both.