new Rectangle(x, y, width, height)

Rectangle constructor.

Parameters

Name Type Optional Description

x

 

 

y

 

 

width

 

 

height

 

 

Methods

static

fromLTRB()

FromLTRB Shared Method Produces a Rectangle class from left, top, right, and bottom coordinates.

static

intersect()

Intersect Shared Method Produces a new Rectangle by intersecting 2 existing Rectangles. Returns null if there is no intersection.

intersectsWithInclusive(rectangle) → boolean

Determines if this rectangle intersects with rect.

Parameter

Name Type Optional Description

rectangle

 

 

Returns

boolean