Rect
Defined in: js-api/src/grid.ts:75
Represents a rectangle.
Constructors
Constructor
new Rect(
x,y,width,height):Rect
Defined in: js-api/src/grid.ts:81
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
width | number |
height | number |
Returns
Rect
Properties
| Property | Type | Defined in |
|---|---|---|
height | number | js-api/src/grid.ts:79 |
width | number | js-api/src/grid.ts:78 |
x | number | js-api/src/grid.ts:76 |
y | number | js-api/src/grid.ts:77 |
Accessors
bottom
Get Signature
get bottom():
number
Defined in: js-api/src/grid.ts:179
Bottom border position of the rectangle along the y-axis.
Returns
number
left
Get Signature
get left():
number
Defined in: js-api/src/grid.ts:164
Left border position of the rectangle along the x-axis.
Returns
number
maxX
Get Signature
get maxX():
number
Defined in: js-api/src/grid.ts:155
Same as (x + width), or (right)
Returns
number
maxY
Get Signature
get maxY():
number
Defined in: js-api/src/grid.ts:161
Same as (y + height), or (bottom)
Returns
number
midX
Get Signature
get midX():
number
Defined in: js-api/src/grid.ts:142
The midpoint of the rectangle along the x-axis.
Returns
number
midY
Get Signature
get midY():
number
Defined in: js-api/src/grid.ts:147
The midpoint of the rectangle along the y-axis.
Returns
number
minX
Get Signature
get minX():
number
Defined in: js-api/src/grid.ts:152
Same as x
Returns
number
minY
Get Signature
get minY():
number
Defined in: js-api/src/grid.ts:158
Same as (y)
Returns
number
right
Get Signature
get right():
number
Defined in: js-api/src/grid.ts:174
Right border position of the rectangle along the x-axis.
Returns
number
top
Get Signature
get top():
number
Defined in: js-api/src/grid.ts:169
Top border position of the rectangle along the y-axis.
Returns
number
Methods
above()
above(
height):Rect
Defined in: js-api/src/grid.ts:304
New rectangle above the original with a height of height.
Parameters
| Parameter | Type | Description |
|---|---|---|
height | number | {number} new rectangle height |
Returns
Rect
below()
below(
height):Rect
Defined in: js-api/src/grid.ts:298
New rectangle below the original with a height of height.
Parameters
| Parameter | Type | Description |
|---|---|---|
height | number | {number} new rectangle height |
Returns
Rect
contains()
contains(
x,y):boolean
Defined in: js-api/src/grid.ts:451
Checks if this Rect contains the point (x; y) inside
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
boolean
containsPoint()
containsPoint(
p):boolean
Defined in: js-api/src/grid.ts:456
Checks if this Rect contains the specified point
Parameters
| Parameter | Type |
|---|---|
p | Point |
Returns
boolean