Skip to content

Api > Rect > Overlaps()


Rect.Overlaps(Rect other, boolean allowInverse)⚓︎

Returns true if the other rectangle overlaps this one. If allowInverse is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.

Parameters:⚓︎

Name Type Description
other Rect Other rectangle to test overlapping with.
allowInverse boolean Does the test allow the widths and heights of the Rects to be negative?

Returns:⚓︎

type Description
boolean True if the other rectangle overlaps this one

Usage⚓︎

---@type Rect
local rect;

---@type Rect
local other;

---@type boolean
local allowInverse;


local val0 = rect.Overlaps(other, allowInverse)