new PIXI.Rectangle(x, y, width, height)
Name | Type | Default | Description |
---|---|---|---|
x |
number | 0 |
optional
The X coordinate of the upper-left corner of the rectangle |
y |
number | 0 |
optional
The Y coordinate of the upper-left corner of the rectangle |
width |
number | 0 |
optional
The overall width of this rectangle |
height |
number | 0 |
optional
The overall height of this rectangle |
Members
-
static,constantPIXI.Rectangle.EMPTY
-
A constant empty rectangle.
-
staticPIXI.Rectangle.Rectangle#bottomnumber
-
returns the bottom edge of the rectangle
-
staticPIXI.Rectangle.Rectangle#rightnumber
-
returns the right edge of the rectangle
-
staticPIXI.Rectangle.Rectangle#topnumber
-
returns the top edge of the rectangle
Methods
-
Creates a clone of this Rectangle
Returns:
Type Description PIXI.Rectangle a copy of the rectangle -
contains(x, y){boolean}
-
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 -
copy(rectangle){PIXI.Rectanle}
-
Copies another rectangle to this one.
Name Type Description rectangle
PIXI.Rectangle The rectangle to copy.
Returns:
Type Description PIXI.Rectanle Returns itself. -
enlarge(rect)
-
Enlarges this rectangle to include the passed rectangle.
Name Type Description rect
PIXI.Rectangle The rectangle to include.
-
fit(rectangle)
-
Fits this rectangle around the passed one.
Name Type Description rectangle
PIXI.Rectangle The rectangle to fit.
-
pad(paddingX, paddingY)
-
Pads the rectangle making it grow in all directions.
Name Type Description paddingX
number The horizontal padding amount.
paddingY
number The vertical padding amount.