1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
/**
* A GraphicsData object.
*
* @class GraphicsData
* @constructor
PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape)
{
this.lineWidth = lineWidth;
this.lineColor = lineColor;
this.lineAlpha = lineAlpha;
this._lineTint = lineColor;
this.fillColor = fillColor;
this.fillAlpha = fillAlpha;
this._fillTint = fillColor;
this.fill = fill;
this.shape = shape;
this.type = shape.type;
};
*/
/**
* A GraphicsData object.
*
* @class
* @memberof PIXI
* @param lineWidth {number} the width of the line to draw
* @param lineColor {number} the color of the line to draw
* @param lineAlpha {number} the alpha of the line to draw
* @param fillColor {number} the color of the fill
* @param fillAlpha {number} the alpha of the fill
* @param fill {boolean} whether or not the shape is filled with a colour
* @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw.
*/
PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) {
/*
* @member {number} the width of the line to draw
*/
this.lineWidth = lineWidth;
/*
* @member {number} the color of the line to draw
*/
this.lineColor = lineColor;
/*
* @member {number} the alpha of the line to draw
*/
this.lineAlpha = lineAlpha;
/*
* @member {number} cached tint of the line to draw
*/
this._lineTint = lineColor;
/*
* @member {number} the color of the fill
*/
this.fillColor = fillColor;
/*
* @member {number} the alpha of the fill
*/
this.fillAlpha = fillAlpha;
/*
* @member {number} cached tint of the fill
*/
this._fillTint = fillColor;
/*
* @member {boolean} whether or not the shape is filled with a color
*/
this.fill = fill;
/*
* @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw.
*/
this.shape = shape;
/*
* @member {number} The type of the shape, see the Const.Shapes file for all the existing types,
*/
this.type = shape.type;
};
PIXI.GraphicsData.prototype.constructor = PIXI.GraphicsData;
/**
* Creates a new GraphicsData object with the same values as this one.
*
* @return {GraphicsData}
*/
PIXI.GraphicsData.prototype.clone = function() {
return new GraphicsData(
this.lineWidth,
this.lineColor,
this.lineAlpha,
this.fillColor,
this.fillAlpha,
this.fill,
this.shape
);
};