diff --git a/src/pixi/geom/Circle.js b/src/pixi/geom/Circle.js index 541e0fe..ad464e9 100644 --- a/src/pixi/geom/Circle.js +++ b/src/pixi/geom/Circle.js @@ -33,6 +33,14 @@ * @default 0 */ this.radius = radius || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Circle.js b/src/pixi/geom/Circle.js index 541e0fe..ad464e9 100644 --- a/src/pixi/geom/Circle.js +++ b/src/pixi/geom/Circle.js @@ -33,6 +33,14 @@ * @default 0 */ this.radius = radius || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Ellipse.js b/src/pixi/geom/Ellipse.js index 0dd71f3..0623625 100644 --- a/src/pixi/geom/Ellipse.js +++ b/src/pixi/geom/Ellipse.js @@ -41,6 +41,15 @@ * @default 0 */ this.height = height || 0; + + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Circle.js b/src/pixi/geom/Circle.js index 541e0fe..ad464e9 100644 --- a/src/pixi/geom/Circle.js +++ b/src/pixi/geom/Circle.js @@ -33,6 +33,14 @@ * @default 0 */ this.radius = radius || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Ellipse.js b/src/pixi/geom/Ellipse.js index 0dd71f3..0623625 100644 --- a/src/pixi/geom/Ellipse.js +++ b/src/pixi/geom/Ellipse.js @@ -41,6 +41,15 @@ * @default 0 */ this.height = height || 0; + + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d615a89..fffe7af 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -29,7 +29,22 @@ } this.closed = true; + + /** + * An array of the points of this polygon + * @property points + * @type Array(Point)|Array(Number) + * + */ this.points = points; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Circle.js b/src/pixi/geom/Circle.js index 541e0fe..ad464e9 100644 --- a/src/pixi/geom/Circle.js +++ b/src/pixi/geom/Circle.js @@ -33,6 +33,14 @@ * @default 0 */ this.radius = radius || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Ellipse.js b/src/pixi/geom/Ellipse.js index 0dd71f3..0623625 100644 --- a/src/pixi/geom/Ellipse.js +++ b/src/pixi/geom/Ellipse.js @@ -41,6 +41,15 @@ * @default 0 */ this.height = height || 0; + + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d615a89..fffe7af 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -29,7 +29,22 @@ } this.closed = true; + + /** + * An array of the points of this polygon + * @property points + * @type Array(Point)|Array(Number) + * + */ this.points = points; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Rectangle.js b/src/pixi/geom/Rectangle.js index 2ccd1d1..85b5442 100644 --- a/src/pixi/geom/Rectangle.js +++ b/src/pixi/geom/Rectangle.js @@ -41,6 +41,14 @@ * @default 0 */ this.height = height || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Circle.js b/src/pixi/geom/Circle.js index 541e0fe..ad464e9 100644 --- a/src/pixi/geom/Circle.js +++ b/src/pixi/geom/Circle.js @@ -33,6 +33,14 @@ * @default 0 */ this.radius = radius || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Ellipse.js b/src/pixi/geom/Ellipse.js index 0dd71f3..0623625 100644 --- a/src/pixi/geom/Ellipse.js +++ b/src/pixi/geom/Ellipse.js @@ -41,6 +41,15 @@ * @default 0 */ this.height = height || 0; + + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d615a89..fffe7af 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -29,7 +29,22 @@ } this.closed = true; + + /** + * An array of the points of this polygon + * @property points + * @type Array(Point)|Array(Number) + * + */ this.points = points; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Rectangle.js b/src/pixi/geom/Rectangle.js index 2ccd1d1..85b5442 100644 --- a/src/pixi/geom/Rectangle.js +++ b/src/pixi/geom/Rectangle.js @@ -41,6 +41,14 @@ * @default 0 */ this.height = height || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/RoundedRectangle.js b/src/pixi/geom/RoundedRectangle.js index dae668d..cebe889 100644 --- a/src/pixi/geom/RoundedRectangle.js +++ b/src/pixi/geom/RoundedRectangle.js @@ -11,7 +11,7 @@ * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle * @param width {Number} The overall width of this rounded rectangle * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} The overall radius of this corners of this rounded rectangle + * @param radius {Number} Controls the radius of the rounded corners */ PIXI.RoundedRectangle = function(x, y, width, height, radius) { @@ -49,6 +49,14 @@ * @default 20 */ this.radius = radius || 20; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Circle.js b/src/pixi/geom/Circle.js index 541e0fe..ad464e9 100644 --- a/src/pixi/geom/Circle.js +++ b/src/pixi/geom/Circle.js @@ -33,6 +33,14 @@ * @default 0 */ this.radius = radius || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Ellipse.js b/src/pixi/geom/Ellipse.js index 0dd71f3..0623625 100644 --- a/src/pixi/geom/Ellipse.js +++ b/src/pixi/geom/Ellipse.js @@ -41,6 +41,15 @@ * @default 0 */ this.height = height || 0; + + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d615a89..fffe7af 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -29,7 +29,22 @@ } this.closed = true; + + /** + * An array of the points of this polygon + * @property points + * @type Array(Point)|Array(Number) + * + */ this.points = points; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Rectangle.js b/src/pixi/geom/Rectangle.js index 2ccd1d1..85b5442 100644 --- a/src/pixi/geom/Rectangle.js +++ b/src/pixi/geom/Rectangle.js @@ -41,6 +41,14 @@ * @default 0 */ this.height = height || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/RoundedRectangle.js b/src/pixi/geom/RoundedRectangle.js index dae668d..cebe889 100644 --- a/src/pixi/geom/RoundedRectangle.js +++ b/src/pixi/geom/RoundedRectangle.js @@ -11,7 +11,7 @@ * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle * @param width {Number} The overall width of this rounded rectangle * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} The overall radius of this corners of this rounded rectangle + * @param radius {Number} Controls the radius of the rounded corners */ PIXI.RoundedRectangle = function(x, y, width, height, radius) { @@ -49,6 +49,14 @@ * @default 20 */ this.radius = radius || 20; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js index 15ed7ae..d870f50 100644 --- a/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js @@ -223,7 +223,7 @@ if(!sprite.texture._uvs)return; } - var uvs, verticies = this.vertices, width, height, w0, w1, h0, h1, index; + var uvs, vertices = this.vertices, width, height, w0, w1, h0, h1, index; uvs = sprite.texture._uvs; @@ -253,89 +253,89 @@ index = this.currentBatchSize * 4 * this.vertSize; // xy - verticies[index++] = w1; - verticies[index++] = h1; + vertices[index++] = w1; + vertices[index++] = h1; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x0; - verticies[index++] = uvs.y1; + vertices[index++] = uvs.x0; + vertices[index++] = uvs.y1; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // xy - verticies[index++] = w0; - verticies[index++] = h1; + vertices[index++] = w0; + vertices[index++] = h1; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x1; - verticies[index++] = uvs.y1; + vertices[index++] = uvs.x1; + vertices[index++] = uvs.y1; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // xy - verticies[index++] = w0; - verticies[index++] = h0; + vertices[index++] = w0; + vertices[index++] = h0; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x2; - verticies[index++] = uvs.y2; + vertices[index++] = uvs.x2; + vertices[index++] = uvs.y2; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // xy - verticies[index++] = w1; - verticies[index++] = h0; + vertices[index++] = w1; + vertices[index++] = h0; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x3; - verticies[index++] = uvs.y3; + vertices[index++] = uvs.x3; + vertices[index++] = uvs.y3; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // increment the batchs this.currentBatchSize++; diff --git a/src/pixi/geom/Circle.js b/src/pixi/geom/Circle.js index 541e0fe..ad464e9 100644 --- a/src/pixi/geom/Circle.js +++ b/src/pixi/geom/Circle.js @@ -33,6 +33,14 @@ * @default 0 */ this.radius = radius || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Ellipse.js b/src/pixi/geom/Ellipse.js index 0dd71f3..0623625 100644 --- a/src/pixi/geom/Ellipse.js +++ b/src/pixi/geom/Ellipse.js @@ -41,6 +41,15 @@ * @default 0 */ this.height = height || 0; + + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Polygon.js b/src/pixi/geom/Polygon.js index d615a89..fffe7af 100644 --- a/src/pixi/geom/Polygon.js +++ b/src/pixi/geom/Polygon.js @@ -29,7 +29,22 @@ } this.closed = true; + + /** + * An array of the points of this polygon + * @property points + * @type Array(Point)|Array(Number) + * + */ this.points = points; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/Rectangle.js b/src/pixi/geom/Rectangle.js index 2ccd1d1..85b5442 100644 --- a/src/pixi/geom/Rectangle.js +++ b/src/pixi/geom/Rectangle.js @@ -41,6 +41,14 @@ * @default 0 */ this.height = height || 0; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/geom/RoundedRectangle.js b/src/pixi/geom/RoundedRectangle.js index dae668d..cebe889 100644 --- a/src/pixi/geom/RoundedRectangle.js +++ b/src/pixi/geom/RoundedRectangle.js @@ -11,7 +11,7 @@ * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle * @param width {Number} The overall width of this rounded rectangle * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} The overall radius of this corners of this rounded rectangle + * @param radius {Number} Controls the radius of the rounded corners */ PIXI.RoundedRectangle = function(x, y, width, height, radius) { @@ -49,6 +49,14 @@ * @default 20 */ this.radius = radius || 20; + + /** + * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case + * @property type + * @type Number + * @default 0 + */ + this.type = 0; }; /** diff --git a/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js index 15ed7ae..d870f50 100644 --- a/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js @@ -223,7 +223,7 @@ if(!sprite.texture._uvs)return; } - var uvs, verticies = this.vertices, width, height, w0, w1, h0, h1, index; + var uvs, vertices = this.vertices, width, height, w0, w1, h0, h1, index; uvs = sprite.texture._uvs; @@ -253,89 +253,89 @@ index = this.currentBatchSize * 4 * this.vertSize; // xy - verticies[index++] = w1; - verticies[index++] = h1; + vertices[index++] = w1; + vertices[index++] = h1; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x0; - verticies[index++] = uvs.y1; + vertices[index++] = uvs.x0; + vertices[index++] = uvs.y1; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // xy - verticies[index++] = w0; - verticies[index++] = h1; + vertices[index++] = w0; + vertices[index++] = h1; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x1; - verticies[index++] = uvs.y1; + vertices[index++] = uvs.x1; + vertices[index++] = uvs.y1; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // xy - verticies[index++] = w0; - verticies[index++] = h0; + vertices[index++] = w0; + vertices[index++] = h0; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x2; - verticies[index++] = uvs.y2; + vertices[index++] = uvs.x2; + vertices[index++] = uvs.y2; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // xy - verticies[index++] = w1; - verticies[index++] = h0; + vertices[index++] = w1; + vertices[index++] = h0; - verticies[index++] = sprite.position.x; - verticies[index++] = sprite.position.y; + vertices[index++] = sprite.position.x; + vertices[index++] = sprite.position.y; //scale - verticies[index++] = sprite.scale.x; - verticies[index++] = sprite.scale.y; + vertices[index++] = sprite.scale.x; + vertices[index++] = sprite.scale.y; //rotation - verticies[index++] = sprite.rotation; + vertices[index++] = sprite.rotation; // uv - verticies[index++] = uvs.x3; - verticies[index++] = uvs.y3; + vertices[index++] = uvs.x3; + vertices[index++] = uvs.y3; // color - verticies[index++] = sprite.alpha; + vertices[index++] = sprite.alpha; // increment the batchs this.currentBatchSize++; diff --git a/src/pixi/utils/Utils.js b/src/pixi/utils/Utils.js index 3cfcff8..1a0127d 100644 --- a/src/pixi/utils/Utils.js +++ b/src/pixi/utils/Utils.js @@ -206,6 +206,13 @@ } }; +/** + * checks if the given width and height make a power of two texture + * @method isPowerOfTwo + * @param width {Number} + * @param height {Number} + * @return {Boolean} + */ PIXI.isPowerOfTwo = function(width, height) { return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);