Rect
Structure representing a rectangle.
The structure has a width, height and a coordinate in a two-dimensional coordinate system.
Properties
Section titled “Properties”height
Section titled “height”Height of rectangle.
height: numberThe height of the rectangle.
Maximum X value.
maxX: numberThe greatest x-coordinate in the rectangle.
Read-only.
Maximum Y value.
maxY: numberThe greatest y-coordinate in the rectangle.
Read-only.
Minimum X value.
minX: numberThe smallest x-coordinate in the rectangle.
Read-only.
Minimum Y value.
minY: numberThe smallest y-coordinate in the rectangle.
Read-only.
origin
Section titled “origin”Point that specifies the rectangles origin.
origin: PointThe x- and y-coordinate that specifies the rectangles origin as a Point structure.
Size of the rectangle.
size: SizeThe width and height of the rectangle as a Size structure.
Width of rectangle.
width: numberThe width of the rectangle.
X value.
x: numberThe x-coordinate of the rectangle.
Y value.
y: numberThe y-coordinate of the rectangle.
Methods
Section titled “Methods”
new Rect(x, y, width, height)
Section titled “new Rect(x, y, width, height)”Constructs a rectangle.
new Rect(x: number, y: number, width: number, height: number)Constructs a new rectangle placed in a two-dimensional coordinate system.
Parameters
Section titled “Parameters”x number
X coordinate.
y number
Y coordinate.
width number
Width of rectangle.
height number
Height of rectangle.