Skip to content

overlap() Usage

KonPet edited this page Jan 9, 2021 · 4 revisions

Description

It checks if one or more corners of a rectangle defined by an x and y, as well as a width and height is overlapping with a second rectangle

Values

bool overlap(x1, y1, w1, h1, // first rectangle
             x3, y3, x4, y4  // second rectangle
)

Example:

if (overlap(0, 0, 3, 4, 2, 1, 3, 5)) {
    // Do something
}