new Polygon(points)
Creates a new Polygon.
The points can be set from a variety of formats:
- An array of Point objects:
[new Phaser.Point(x1, y1), ...]
- An array of objects with public x/y properties:
[obj1, obj2, ...]
- An array of paired numbers that represent point coordinates:
[x1,y1, x2,y2, ...]
- As separate Point arguments:
setTo(new Phaser.Point(x1, y1), ...)
- As separate objects with public x/y properties arguments:
setTo(obj1, obj2, ...)
- As separate arguments representing point coordinates:
setTo(x1,y1, x2,y2, ...)
Parameters
Name | Type | Description |
---|---|---|
points | Array.<Phaser.Point> | Array.<number> | Phaser.Point | number | The points to set. |
- Source code: geom/Polygon.js (Line 24)
Please login to continue.