Register for the online Blockly Developer Summit April 28-29, 2021!

Namespace: Rect

Properties

bottom

number

left

number

number

top

number

Methods

contains

contains(x, y) returns boolean

Tests whether this rectangle contains a x/y coordinate.

Parameter

x

number

The x coordinate to test for containment.

y

number

The y coordinate to test for containment.

Returns

boolean Whether this rectangle contains given coordinate.

intersects

intersects(other) returns boolean

Tests whether this rectangle intersects the provided rectangle. Assumes that the coordinate system increases going down and left.

Parameter

other

Blockly.utils.Rect

The other rectangle to check for intersection with.

Returns

boolean Whether this rectangle intersects the provided rectangle.