Sets this Polygon to the given points.
The points can be set from a variety of formats:
'40 0 40 20 100 20 100 80 40 80 40 100 0 50'
[new Phaser.Point(x1, y1), ...]
[obj1, obj2, ...]
[x1,y1, x2,y2, ...]
[[x1, y1], [x2, y2], ...]
Calling this method will reset the size (width, height) and display origin of this Shape.
It also runs both GetAABB and EarCut on the given points, so please be careful not to do this at a high frequency, or with too many points.
name | type | arguments | description |
---|---|---|---|
points | string | Array.<number> | Array.<Phaser.Types.Math.Vector2Like> | <optional> |
Points defining the perimeter of this polygon. Please check function description above for the different supported formats. |
This Game Object instance.