2013-11-05 19:31:33 +00:00
|
|
|
/**
|
2013-11-07 06:10:15 +00:00
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2014-02-05 05:54:25 +00:00
|
|
|
* @copyright 2014 Photon Storm Ltd.
|
2013-11-07 06:10:15 +00:00
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new Polygon. You have to provide a list of points.
|
|
|
|
* 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. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
|
|
|
|
* arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are numbers.
|
|
|
|
*
|
2013-11-05 19:31:33 +00:00
|
|
|
* @class Phaser.Polygon
|
|
|
|
* @classdesc The polygon represents a list of orderded points in space
|
|
|
|
* @constructor
|
2013-11-07 06:10:15 +00:00
|
|
|
* @param {Array<Phaser.Point>|Array<number>} points - The array of Points.
|
|
|
|
*/
|
2013-11-05 19:25:06 +00:00
|
|
|
Phaser.Polygon = function (points) {
|
|
|
|
|
|
|
|
PIXI.Polygon.call(this, points);
|
|
|
|
|
|
|
|
/**
|
2013-11-25 03:13:04 +00:00
|
|
|
* @property {number} type - The base object type.
|
|
|
|
*/
|
2013-11-05 19:25:06 +00:00
|
|
|
this.type = Phaser.POLYGON;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Phaser.Polygon.prototype = Object.create(PIXI.Polygon.prototype);
|
|
|
|
Phaser.Polygon.prototype.constructor = Phaser.Polygon;
|