diff --git a/src/pixi/core/Matrix.js b/src/pixi/core/Matrix.js index 6f6f748..df1fd07 100644 --- a/src/pixi/core/Matrix.js +++ b/src/pixi/core/Matrix.js @@ -2,27 +2,16 @@ * @author Mat Groves http://matgroves.com/ @Doormat23 */ -PIXI.determineMatrixArrayType = function() { - return (typeof Float32Array !== 'undefined') ? Float32Array : Array; -}; - -/* -* @class Matrix2 -* The Matrix2 class will choose the best type of array to use between -* a regular javascript Array and a Float32Array if the latter is available -* -*/ -PIXI.Matrix2 = PIXI.determineMatrixArrayType(); - -/* -* @class Matrix -* The Matrix class is now an object, which makes it a lot faster, -* here is a representation of it : -* | a | b | tx| -* | c | c | ty| -* | 0 | 0 | 1 | -* -*/ +/** + * The Matrix class is now an object, which makes it a lot faster, + * here is a representation of it : + * | a | b | tx| + * | c | c | ty| + * | 0 | 0 | 1 | + * + * @class Matrix + * @constructor + */ PIXI.Matrix = function() { this.a = 1; @@ -54,7 +43,7 @@ * * @method toArray * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return array {Array} the newly created array which contains the matrix + * @return {Array} the newly created array which contains the matrix */ PIXI.Matrix.prototype.toArray = function(transpose) { @@ -89,4 +78,17 @@ return array; }; -PIXI.identityMatrix = new PIXI.Matrix(); \ No newline at end of file +PIXI.identityMatrix = new PIXI.Matrix(); + +PIXI.determineMatrixArrayType = function() { + return (typeof Float32Array !== 'undefined') ? Float32Array : Array; +}; + +/** + * The Matrix2 class will choose the best type of array to use between + * a regular javascript Array and a Float32Array if the latter is available + * + * @class Matrix2 + * @constructor + */ +PIXI.Matrix2 = PIXI.determineMatrixArrayType(); diff --git a/src/pixi/core/Matrix.js b/src/pixi/core/Matrix.js index 6f6f748..df1fd07 100644 --- a/src/pixi/core/Matrix.js +++ b/src/pixi/core/Matrix.js @@ -2,27 +2,16 @@ * @author Mat Groves http://matgroves.com/ @Doormat23 */ -PIXI.determineMatrixArrayType = function() { - return (typeof Float32Array !== 'undefined') ? Float32Array : Array; -}; - -/* -* @class Matrix2 -* The Matrix2 class will choose the best type of array to use between -* a regular javascript Array and a Float32Array if the latter is available -* -*/ -PIXI.Matrix2 = PIXI.determineMatrixArrayType(); - -/* -* @class Matrix -* The Matrix class is now an object, which makes it a lot faster, -* here is a representation of it : -* | a | b | tx| -* | c | c | ty| -* | 0 | 0 | 1 | -* -*/ +/** + * The Matrix class is now an object, which makes it a lot faster, + * here is a representation of it : + * | a | b | tx| + * | c | c | ty| + * | 0 | 0 | 1 | + * + * @class Matrix + * @constructor + */ PIXI.Matrix = function() { this.a = 1; @@ -54,7 +43,7 @@ * * @method toArray * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return array {Array} the newly created array which contains the matrix + * @return {Array} the newly created array which contains the matrix */ PIXI.Matrix.prototype.toArray = function(transpose) { @@ -89,4 +78,17 @@ return array; }; -PIXI.identityMatrix = new PIXI.Matrix(); \ No newline at end of file +PIXI.identityMatrix = new PIXI.Matrix(); + +PIXI.determineMatrixArrayType = function() { + return (typeof Float32Array !== 'undefined') ? Float32Array : Array; +}; + +/** + * The Matrix2 class will choose the best type of array to use between + * a regular javascript Array and a Float32Array if the latter is available + * + * @class Matrix2 + * @constructor + */ +PIXI.Matrix2 = PIXI.determineMatrixArrayType(); diff --git a/src/pixi/core/Point.js b/src/pixi/core/Point.js index a3c8e5e..202bc2f 100644 --- a/src/pixi/core/Point.js +++ b/src/pixi/core/Point.js @@ -38,12 +38,19 @@ return new PIXI.Point(this.x, this.y); }; -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; - +/** + * Sets the point to a new x and y position. + * If y is ommited, both x and y will be set to x. + * + * @method set + * @param [x=0] {Number} position of the point on the x axis + * @param [y=0] {Number} position of the point on the y axis + */ PIXI.Point.prototype.set = function(x, y) { this.x = x || 0; this.y = y || ( (y !== 0) ? this.x : 0 ) ; }; +// constructor +PIXI.Point.prototype.constructor = PIXI.Point; \ No newline at end of file