:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the Rect2i.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_Rect2i: Rect2i ====== 2D axis-aligned bounding box using integer coordinates. Description ----------- ``Rect2i`` consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. It uses integer coordinates. Tutorials --------- - :doc:`../tutorials/math/index` Methods ------- +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2i` | :ref:`Rect2i` **(** :ref:`Vector2` position, :ref:`Vector2` size **)** | +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2i` | :ref:`Rect2i` **(** :ref:`int` x, :ref:`int` y, :ref:`int` width, :ref:`int` height **)** | +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2i` | :ref:`Rect2i` **(** :ref:`Rect2` from **)** | +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_Rect2i_method_Rect2i: - :ref:`Rect2i` **Rect2i** **(** :ref:`Vector2` position, :ref:`Vector2` size **)** Constructs a ``Rect2i`` by position and size. ---- - :ref:`Rect2i` **Rect2i** **(** :ref:`int` x, :ref:`int` y, :ref:`int` width, :ref:`int` height **)** Constructs a ``Rect2i`` by x, y, width, and height. ---- - :ref:`Rect2i` **Rect2i** **(** :ref:`Rect2` from **)** Constructs a new ``Rect2i`` from :ref:`Rect2`. The floating point coordinates will be truncated.