Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
number |
<optional> |
0 |
The X coordinate of the upper-left corner of the rectangle |
y |
number |
<optional> |
0 |
The Y coordinate of the upper-left corner of the rectangle |
width |
number |
<optional> |
0 |
The overall width of this rectangle |
height |
number |
<optional> |
0 |
The overall height of this rectangle |
Members
PIXI.Rectangle.EMPTY PIXI.Rectangle static
A constant empty rectangle.
returns the bottom edge of the rectangle
- Default Value:
- 0
returns the left edge of the rectangle
returns the right edge of the rectangle
returns the top edge of the rectangle
The type of the object, mainly used to avoid instanceof
checks
- Default Value:
- PIXI.SHAPES.RECT
- See:
- Default Value:
- 0
- Default Value:
- 0
- Default Value:
- 0
Methods
ceil (resolution, eps) PIXI.Rectangle
Enlarges rectangle that way its corners lie on grid
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resolution |
number |
<optional> |
1 |
resolution |
eps |
number |
<optional> |
0.001 |
precision |
Returns:
Type | Description |
---|---|
PIXI.Rectangle | Returns itself. |
clone () PIXI.Rectangle
Creates a clone of this Rectangle
Returns:
Type | Description |
---|---|
PIXI.Rectangle | a copy of the rectangle |
Checks whether the x and y coordinates given are contained within this Rectangle
Name | Type | Description |
---|---|---|
x |
number |
The X coordinate of the point to test |
y |
number |
The Y coordinate of the point to test |
Returns:
Type | Description |
---|---|
boolean | Whether the x/y coordinates are within this Rectangle |
copyFrom (rectangle) PIXI.Rectangle
Copies another rectangle to this one.
Name | Type | Description |
---|---|---|
rectangle |
PIXI.Rectangle |
The rectangle to copy from. |
Returns:
Type | Description |
---|---|
PIXI.Rectangle | Returns itself. |
copyTo (rectangle) PIXI.Rectangle
Copies this rectangle to another one.
Name | Type | Description |
---|---|---|
rectangle |
PIXI.Rectangle |
The rectangle to copy to. |
Returns:
Type | Description |
---|---|
PIXI.Rectangle | Returns given parameter. |
enlarge (rectangle) PIXI.Rectangle
Enlarges this rectangle to include the passed rectangle.
Name | Type | Description |
---|---|---|
rectangle |
PIXI.Rectangle |
The rectangle to include. |
Returns:
Type | Description |
---|---|
PIXI.Rectangle | Returns itself. |
fit (rectangle) PIXI.Rectangle
Fits this rectangle around the passed one.
Name | Type | Description |
---|---|---|
rectangle |
PIXI.Rectangle |
The rectangle to fit. |
Returns:
Type | Description |
---|---|
PIXI.Rectangle | Returns itself. |
pad (paddingX, paddingY) PIXI.Rectangle
Pads the rectangle making it grow in all directions. If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
paddingX |
number |
<optional> |
0 |
The horizontal padding amount. |
paddingY |
number |
<optional> |
0 |
The vertical padding amount. |
Returns:
Type | Description |
---|---|
PIXI.Rectangle | Returns itself. |