new Polygon(points)
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<Point> | Array.<Number> | PIXI.Point | Number | This can be an array of Points that form the polygon,
a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
all the points of the polygon e.g. |
- Source - pixi/geom/Polygon.js, line 5
Methods
-
clone() → {PIXI.Polygon}
-
Creates a clone of this polygon
Returns:
a copy of the polygon
- Source - pixi/geom/Polygon.js, line 35
-
contains(x, y) → {Boolean}
-
Checks whether the x and y coordinates passed to this function are contained within this polygon
Parameters:
Name Type Description x
Number The X coordinate of the point to test
y
Number The Y coordinate of the point to test
Returns:
Boolean -Whether the x/y coordinates are within this polygon
- Source - pixi/geom/Polygon.js, line 47