mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Added new format for polygon points
This commit is contained in:
parent
763557af5d
commit
a53676a924
1 changed files with 5 additions and 0 deletions
|
@ -163,6 +163,7 @@ Phaser.Polygon.prototype = {
|
|||
* - 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, ...]`
|
||||
* - An array of arrays with two elements representing x/y 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, ...)`
|
||||
|
@ -196,6 +197,10 @@ Phaser.Polygon.prototype = {
|
|||
var p = new PIXI.Point(points[i], points[i + 1]);
|
||||
i++;
|
||||
}
|
||||
else if (Array.isArray(points[i])
|
||||
{
|
||||
var p = new PIXI.Point(points[i][0], points[i][1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
var p = new PIXI.Point(points[i].x, points[i].y);
|
||||
|
|
Loading…
Reference in a new issue