new Rect(x, y, width, height)
Rectは四角のエリアです。
Parameters:
Name | Type | Description |
---|---|---|
x |
number | |
y |
number | |
width |
number | |
height |
number |
- Implements:
Members
(constant) initializer :string
The name of constructor the class, will be used to restore the object.
The constructor has to be accessable via
window[initializer]
Type:
- string
- Implements:
Methods
coverCoordinate(x, y) → {boolean}
Is point inside rect?
Parameters:
Name | Type | Description |
---|---|---|
x |
number | |
y |
number |
Returns:
- Type
- boolean
extend(otherRect) → {Rect}
Return a larger rect that contain both rects
Parameters:
Name | Type | Description |
---|---|---|
otherRect |
Rect |
Returns:
- Type
- Rect
intersect(otherRect) → {boolean}
Are these 2 rects intersecting?
Parameters:
Name | Type | Description |
---|---|---|
otherRect |
Rect |
Returns:
- Type
- boolean
isEqual(otherRect) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
otherRect |
Rect |
Returns:
- Type
- boolean
isZero() → {boolean}
Is this rect a zero rect?
Returns:
- Type
- boolean
round()
Modify this rect, round the number to the nearest integer.