new PIXI.Polygon(points)
Name | Type | Description |
---|---|---|
points |
Array.<PIXI.Point> | Array.<number> |
repeatable
This can be an array of Points |
Members
-
pointsArray.<number>
-
An array of the points of this polygon
-
readonlytypenumber
-
The type of the object, mainly used to avoid
instanceof
checks- Default Value:
- PIXI.SHAPES.POLY
- See:
Methods
-
clone(){PIXI.Polygon}
-
Creates a clone of this polygon
Returns:
Type Description PIXI.Polygon a copy of the polygon -
close()
-
Closes the polygon, adding points if necessary.
-
contains(x, y){boolean}
-
Checks whether the x and y coordinates passed to this function are contained within this polygon
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 polygon