Skip to content

Ui.doRectsIntersect

kerrishotts edited this page Apr 1, 2013 · 1 revision

(part of UI)

Returns: boolean

Parameters: aRect (rect), bRect (rect)

Returns true if the two rectangles intersect, and false if they don't. The rectangles must be canonical; that is, there should be no negative sizes on either.

Usage

var aRect = UI.makeRect ( UI.makePoint (10, 15), UI.makeSize (100, 150) );
var bRect = UI.makeRect ( UI.makePoint (50, 60), UI.makeSize (25, 35 ) );
if (UI.doRectsIntersect ( aRect, bRect ))
{
    ...
}

Version

0.3 Introduced; Docs Valid

Clone this wiki locally