Rectangle
Rectangle
Kind: global class
- Rectangle
- new Rectangle(x, y, width, height)
- .position :
Vector2
- .size :
Vector2
- .x0 ⇒
number
- .x1 ⇒
number
- .y0 ⇒
number
- .y1 ⇒
number
- .isRectangle :
boolean
- .set(x, y, width, height)
- .clone() ⇒
Rectangle
- .copy(other)
- ._intersects(x0, y0, x1, y1) ⇒
boolean
- .intersects(other) ⇒
boolean
- ._overlaps(x0, y0, x1, y1) ⇒
boolean
- .overlaps(other) ⇒
boolean
- ._resizeToFit(x0, y0, x1, y1)
- .resizeToFit(other)
- ._contains(x0, y0, x1, y1) ⇒
boolean
- .contains(other) ⇒
boolean
- .computeCenter(result)
- .computeArea() ⇒
number
- .toArray(target, [targetOffset])
new Rectangle(x, y, width, height)
Param | Type | Default |
---|---|---|
x | number | 0 |
y | number | 0 |
width | number | 0 |
height | number | 0 |
rectangle.position : Vector2
Kind: instance property of Rectangle
Read only: true
rectangle.size : Vector2
Kind: instance property of Rectangle
Read only: true
rectangle.x0 ⇒ number
Kind: instance property of Rectangle
rectangle.x1 ⇒ number
Kind: instance property of Rectangle
rectangle.y0 ⇒ number
Kind: instance property of Rectangle
rectangle.y1 ⇒ number
Kind: instance property of Rectangle
rectangle.isRectangle : boolean
Kind: instance property of Rectangle
Read only: true
rectangle.set(x, y, width, height)
Kind: instance method of Rectangle
Param | Type |
---|---|
x | number |
y | number |
width | number |
height | number |
rectangle.clone() ⇒ Rectangle
Kind: instance method of Rectangle
rectangle.copy(other)
Kind: instance method of Rectangle
Param | Type |
---|---|
other | Rectangle |
rectangle._intersects(x0, y0, x1, y1) ⇒ boolean
Kind: instance method of Rectangle
Param | Type |
---|---|
x0 | number |
y0 | number |
x1 | number |
y1 | number |
rectangle.intersects(other) ⇒ boolean
Kind: instance method of Rectangle
Param | Type |
---|---|
other | Rectangle |
rectangle._overlaps(x0, y0, x1, y1) ⇒ boolean
Kind: instance method of Rectangle
Param | Type |
---|---|
x0 | number |
y0 | number |
x1 | number |
y1 | number |
rectangle.overlaps(other) ⇒ boolean
Kind: instance method of Rectangle
Param | Type |
---|---|
other | Rectangle |
rectangle._resizeToFit(x0, y0, x1, y1)
Kind: instance method of Rectangle
Param | Type |
---|---|
x0 | number |
y0 | number |
x1 | number |
y1 | number |
rectangle.resizeToFit(other)
Kind: instance method of Rectangle
Param | Type |
---|---|
other | Rectangle |
rectangle._contains(x0, y0, x1, y1) ⇒ boolean
Kind: instance method of Rectangle
Param | Type |
---|---|
x0 | number |
y0 | number |
x1 | number |
y1 | number |
rectangle.contains(other) ⇒ boolean
Kind: instance method of Rectangle
Param | Type |
---|---|
other | Rectangle |
rectangle.computeCenter(result)
Kind: instance method of Rectangle
Param | Type |
---|---|
result | Vector2 |
rectangle.computeArea() ⇒ number
Kind: instance method of Rectangle
rectangle.toArray(target, [targetOffset])
Kind: instance method of Rectangle
Param | Type | Default |
---|---|---|
target | Array.<number> | Float32Array | Float64Array | Uint8Array | |
[targetOffset] | number | 0 |