diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/filters/fxaa/FXAAFilter.js b/src/filters/fxaa/FXAAFilter.js index b2a77c7..9b5e8b4 100644 --- a/src/filters/fxaa/FXAAFilter.js +++ b/src/filters/fxaa/FXAAFilter.js @@ -7,9 +7,7 @@ * modification that the texture2DLod stuff was removed since it's * unsupported by WebGL. * - * -- - * From: - * https://github.com/mitsuhiko/webgl-meincraft + * @see https://github.com/mitsuhiko/webgl-meincraft * * @class * @extends PIXI.Filter diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/filters/fxaa/FXAAFilter.js b/src/filters/fxaa/FXAAFilter.js index b2a77c7..9b5e8b4 100644 --- a/src/filters/fxaa/FXAAFilter.js +++ b/src/filters/fxaa/FXAAFilter.js @@ -7,9 +7,7 @@ * modification that the texture2DLod stuff was removed since it's * unsupported by WebGL. * - * -- - * From: - * https://github.com/mitsuhiko/webgl-meincraft + * @see https://github.com/mitsuhiko/webgl-meincraft * * @class * @extends PIXI.Filter diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 29757a5..0d9ba00 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -105,6 +105,7 @@ /** * @member {Function} + * @private */ this.onMouseUp = this.onMouseUp.bind(this); this.processMouseUp = this.processMouseUp.bind( this ); @@ -112,18 +113,21 @@ /** * @member {Function} + * @private */ this.onMouseDown = this.onMouseDown.bind(this); this.processMouseDown = this.processMouseDown.bind( this ); /** * @member {Function} + * @private */ this.onMouseMove = this.onMouseMove.bind( this ); this.processMouseMove = this.processMouseMove.bind( this ); /** * @member {Function} + * @private */ this.onMouseOut = this.onMouseOut.bind(this); this.processMouseOverOut = this.processMouseOverOut.bind( this ); @@ -131,28 +135,26 @@ /** * @member {Function} + * @private */ this.onTouchStart = this.onTouchStart.bind(this); this.processTouchStart = this.processTouchStart.bind(this); /** * @member {Function} + * @private */ this.onTouchEnd = this.onTouchEnd.bind(this); this.processTouchEnd = this.processTouchEnd.bind(this); /** * @member {Function} + * @private */ this.onTouchMove = this.onTouchMove.bind(this); this.processTouchMove = this.processTouchMove.bind(this); /** - * @member {number} - */ - this.last = 0; - - /** * Every update cursor will be reset to this value, if some element wont override it in its hitTest * @member {string} * @default 'inherit' @@ -279,7 +281,7 @@ * Invoked by a throttled ticker update from * {@link PIXI.ticker.shared}. * - * @param deltaTime {number} + * @param deltaTime {number} time delta since last tick */ InteractionManager.prototype.update = function (deltaTime) { @@ -750,6 +752,7 @@ * Is called when a touch ends on the renderer element * * @param event {Event} The DOM event of a touch ending on the renderer view + * @private */ InteractionManager.prototype.onTouchEnd = function (event) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/filters/fxaa/FXAAFilter.js b/src/filters/fxaa/FXAAFilter.js index b2a77c7..9b5e8b4 100644 --- a/src/filters/fxaa/FXAAFilter.js +++ b/src/filters/fxaa/FXAAFilter.js @@ -7,9 +7,7 @@ * modification that the texture2DLod stuff was removed since it's * unsupported by WebGL. * - * -- - * From: - * https://github.com/mitsuhiko/webgl-meincraft + * @see https://github.com/mitsuhiko/webgl-meincraft * * @class * @extends PIXI.Filter diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 29757a5..0d9ba00 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -105,6 +105,7 @@ /** * @member {Function} + * @private */ this.onMouseUp = this.onMouseUp.bind(this); this.processMouseUp = this.processMouseUp.bind( this ); @@ -112,18 +113,21 @@ /** * @member {Function} + * @private */ this.onMouseDown = this.onMouseDown.bind(this); this.processMouseDown = this.processMouseDown.bind( this ); /** * @member {Function} + * @private */ this.onMouseMove = this.onMouseMove.bind( this ); this.processMouseMove = this.processMouseMove.bind( this ); /** * @member {Function} + * @private */ this.onMouseOut = this.onMouseOut.bind(this); this.processMouseOverOut = this.processMouseOverOut.bind( this ); @@ -131,28 +135,26 @@ /** * @member {Function} + * @private */ this.onTouchStart = this.onTouchStart.bind(this); this.processTouchStart = this.processTouchStart.bind(this); /** * @member {Function} + * @private */ this.onTouchEnd = this.onTouchEnd.bind(this); this.processTouchEnd = this.processTouchEnd.bind(this); /** * @member {Function} + * @private */ this.onTouchMove = this.onTouchMove.bind(this); this.processTouchMove = this.processTouchMove.bind(this); /** - * @member {number} - */ - this.last = 0; - - /** * Every update cursor will be reset to this value, if some element wont override it in its hitTest * @member {string} * @default 'inherit' @@ -279,7 +281,7 @@ * Invoked by a throttled ticker update from * {@link PIXI.ticker.shared}. * - * @param deltaTime {number} + * @param deltaTime {number} time delta since last tick */ InteractionManager.prototype.update = function (deltaTime) { @@ -750,6 +752,7 @@ * Is called when a touch ends on the renderer element * * @param event {Event} The DOM event of a touch ending on the renderer view + * @private */ InteractionManager.prototype.onTouchEnd = function (event) { diff --git a/src/loaders/loader.js b/src/loaders/loader.js index 07ca093..dbce851 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -24,6 +24,7 @@ * @memberof PIXI.loaders * @param [baseUrl=''] {string} The base url for all resources loaded by this loader. * @param [concurrency=10] {number} The number of resources to load concurrently. + * @see https://github.com/englercj/resource-loader */ function Loader(baseUrl, concurrency) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/filters/fxaa/FXAAFilter.js b/src/filters/fxaa/FXAAFilter.js index b2a77c7..9b5e8b4 100644 --- a/src/filters/fxaa/FXAAFilter.js +++ b/src/filters/fxaa/FXAAFilter.js @@ -7,9 +7,7 @@ * modification that the texture2DLod stuff was removed since it's * unsupported by WebGL. * - * -- - * From: - * https://github.com/mitsuhiko/webgl-meincraft + * @see https://github.com/mitsuhiko/webgl-meincraft * * @class * @extends PIXI.Filter diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 29757a5..0d9ba00 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -105,6 +105,7 @@ /** * @member {Function} + * @private */ this.onMouseUp = this.onMouseUp.bind(this); this.processMouseUp = this.processMouseUp.bind( this ); @@ -112,18 +113,21 @@ /** * @member {Function} + * @private */ this.onMouseDown = this.onMouseDown.bind(this); this.processMouseDown = this.processMouseDown.bind( this ); /** * @member {Function} + * @private */ this.onMouseMove = this.onMouseMove.bind( this ); this.processMouseMove = this.processMouseMove.bind( this ); /** * @member {Function} + * @private */ this.onMouseOut = this.onMouseOut.bind(this); this.processMouseOverOut = this.processMouseOverOut.bind( this ); @@ -131,28 +135,26 @@ /** * @member {Function} + * @private */ this.onTouchStart = this.onTouchStart.bind(this); this.processTouchStart = this.processTouchStart.bind(this); /** * @member {Function} + * @private */ this.onTouchEnd = this.onTouchEnd.bind(this); this.processTouchEnd = this.processTouchEnd.bind(this); /** * @member {Function} + * @private */ this.onTouchMove = this.onTouchMove.bind(this); this.processTouchMove = this.processTouchMove.bind(this); /** - * @member {number} - */ - this.last = 0; - - /** * Every update cursor will be reset to this value, if some element wont override it in its hitTest * @member {string} * @default 'inherit' @@ -279,7 +281,7 @@ * Invoked by a throttled ticker update from * {@link PIXI.ticker.shared}. * - * @param deltaTime {number} + * @param deltaTime {number} time delta since last tick */ InteractionManager.prototype.update = function (deltaTime) { @@ -750,6 +752,7 @@ * Is called when a touch ends on the renderer element * * @param event {Event} The DOM event of a touch ending on the renderer view + * @private */ InteractionManager.prototype.onTouchEnd = function (event) { diff --git a/src/loaders/loader.js b/src/loaders/loader.js index 07ca093..dbce851 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -24,6 +24,7 @@ * @memberof PIXI.loaders * @param [baseUrl=''] {string} The base url for all resources loaded by this loader. * @param [concurrency=10] {number} The number of resources to load concurrently. + * @see https://github.com/englercj/resource-loader */ function Loader(baseUrl, concurrency) { diff --git a/src/mesh/webgl/MeshShader.js b/src/mesh/webgl/MeshShader.js index dda3e46..3ea61c3 100644 --- a/src/mesh/webgl/MeshShader.js +++ b/src/mesh/webgl/MeshShader.js @@ -4,7 +4,7 @@ * @class * @extends PIXI.Shader * @memberof PIXI.mesh - * @param gl {Shader} TODO: Find a good explanation for this. + * @param gl {PIXI.Shader} TODO: Find a good explanation for this. */ function MeshShader(gl) { diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/filters/fxaa/FXAAFilter.js b/src/filters/fxaa/FXAAFilter.js index b2a77c7..9b5e8b4 100644 --- a/src/filters/fxaa/FXAAFilter.js +++ b/src/filters/fxaa/FXAAFilter.js @@ -7,9 +7,7 @@ * modification that the texture2DLod stuff was removed since it's * unsupported by WebGL. * - * -- - * From: - * https://github.com/mitsuhiko/webgl-meincraft + * @see https://github.com/mitsuhiko/webgl-meincraft * * @class * @extends PIXI.Filter diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 29757a5..0d9ba00 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -105,6 +105,7 @@ /** * @member {Function} + * @private */ this.onMouseUp = this.onMouseUp.bind(this); this.processMouseUp = this.processMouseUp.bind( this ); @@ -112,18 +113,21 @@ /** * @member {Function} + * @private */ this.onMouseDown = this.onMouseDown.bind(this); this.processMouseDown = this.processMouseDown.bind( this ); /** * @member {Function} + * @private */ this.onMouseMove = this.onMouseMove.bind( this ); this.processMouseMove = this.processMouseMove.bind( this ); /** * @member {Function} + * @private */ this.onMouseOut = this.onMouseOut.bind(this); this.processMouseOverOut = this.processMouseOverOut.bind( this ); @@ -131,28 +135,26 @@ /** * @member {Function} + * @private */ this.onTouchStart = this.onTouchStart.bind(this); this.processTouchStart = this.processTouchStart.bind(this); /** * @member {Function} + * @private */ this.onTouchEnd = this.onTouchEnd.bind(this); this.processTouchEnd = this.processTouchEnd.bind(this); /** * @member {Function} + * @private */ this.onTouchMove = this.onTouchMove.bind(this); this.processTouchMove = this.processTouchMove.bind(this); /** - * @member {number} - */ - this.last = 0; - - /** * Every update cursor will be reset to this value, if some element wont override it in its hitTest * @member {string} * @default 'inherit' @@ -279,7 +281,7 @@ * Invoked by a throttled ticker update from * {@link PIXI.ticker.shared}. * - * @param deltaTime {number} + * @param deltaTime {number} time delta since last tick */ InteractionManager.prototype.update = function (deltaTime) { @@ -750,6 +752,7 @@ * Is called when a touch ends on the renderer element * * @param event {Event} The DOM event of a touch ending on the renderer view + * @private */ InteractionManager.prototype.onTouchEnd = function (event) { diff --git a/src/loaders/loader.js b/src/loaders/loader.js index 07ca093..dbce851 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -24,6 +24,7 @@ * @memberof PIXI.loaders * @param [baseUrl=''] {string} The base url for all resources loaded by this loader. * @param [concurrency=10] {number} The number of resources to load concurrently. + * @see https://github.com/englercj/resource-loader */ function Loader(baseUrl, concurrency) { diff --git a/src/mesh/webgl/MeshShader.js b/src/mesh/webgl/MeshShader.js index dda3e46..3ea61c3 100644 --- a/src/mesh/webgl/MeshShader.js +++ b/src/mesh/webgl/MeshShader.js @@ -4,7 +4,7 @@ * @class * @extends PIXI.Shader * @memberof PIXI.mesh - * @param gl {Shader} TODO: Find a good explanation for this. + * @param gl {PIXI.Shader} TODO: Find a good explanation for this. */ function MeshShader(gl) { diff --git a/src/particles/index.js b/src/particles/index.js index 4a93acb..68d4dc7 100644 --- a/src/particles/index.js +++ b/src/particles/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.mesh + * @namespace PIXI.particles */ module.exports = { ParticleContainer: require('./ParticleContainer'), diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/filters/fxaa/FXAAFilter.js b/src/filters/fxaa/FXAAFilter.js index b2a77c7..9b5e8b4 100644 --- a/src/filters/fxaa/FXAAFilter.js +++ b/src/filters/fxaa/FXAAFilter.js @@ -7,9 +7,7 @@ * modification that the texture2DLod stuff was removed since it's * unsupported by WebGL. * - * -- - * From: - * https://github.com/mitsuhiko/webgl-meincraft + * @see https://github.com/mitsuhiko/webgl-meincraft * * @class * @extends PIXI.Filter diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 29757a5..0d9ba00 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -105,6 +105,7 @@ /** * @member {Function} + * @private */ this.onMouseUp = this.onMouseUp.bind(this); this.processMouseUp = this.processMouseUp.bind( this ); @@ -112,18 +113,21 @@ /** * @member {Function} + * @private */ this.onMouseDown = this.onMouseDown.bind(this); this.processMouseDown = this.processMouseDown.bind( this ); /** * @member {Function} + * @private */ this.onMouseMove = this.onMouseMove.bind( this ); this.processMouseMove = this.processMouseMove.bind( this ); /** * @member {Function} + * @private */ this.onMouseOut = this.onMouseOut.bind(this); this.processMouseOverOut = this.processMouseOverOut.bind( this ); @@ -131,28 +135,26 @@ /** * @member {Function} + * @private */ this.onTouchStart = this.onTouchStart.bind(this); this.processTouchStart = this.processTouchStart.bind(this); /** * @member {Function} + * @private */ this.onTouchEnd = this.onTouchEnd.bind(this); this.processTouchEnd = this.processTouchEnd.bind(this); /** * @member {Function} + * @private */ this.onTouchMove = this.onTouchMove.bind(this); this.processTouchMove = this.processTouchMove.bind(this); /** - * @member {number} - */ - this.last = 0; - - /** * Every update cursor will be reset to this value, if some element wont override it in its hitTest * @member {string} * @default 'inherit' @@ -279,7 +281,7 @@ * Invoked by a throttled ticker update from * {@link PIXI.ticker.shared}. * - * @param deltaTime {number} + * @param deltaTime {number} time delta since last tick */ InteractionManager.prototype.update = function (deltaTime) { @@ -750,6 +752,7 @@ * Is called when a touch ends on the renderer element * * @param event {Event} The DOM event of a touch ending on the renderer view + * @private */ InteractionManager.prototype.onTouchEnd = function (event) { diff --git a/src/loaders/loader.js b/src/loaders/loader.js index 07ca093..dbce851 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -24,6 +24,7 @@ * @memberof PIXI.loaders * @param [baseUrl=''] {string} The base url for all resources loaded by this loader. * @param [concurrency=10] {number} The number of resources to load concurrently. + * @see https://github.com/englercj/resource-loader */ function Loader(baseUrl, concurrency) { diff --git a/src/mesh/webgl/MeshShader.js b/src/mesh/webgl/MeshShader.js index dda3e46..3ea61c3 100644 --- a/src/mesh/webgl/MeshShader.js +++ b/src/mesh/webgl/MeshShader.js @@ -4,7 +4,7 @@ * @class * @extends PIXI.Shader * @memberof PIXI.mesh - * @param gl {Shader} TODO: Find a good explanation for this. + * @param gl {PIXI.Shader} TODO: Find a good explanation for this. */ function MeshShader(gl) { diff --git a/src/particles/index.js b/src/particles/index.js index 4a93acb..68d4dc7 100644 --- a/src/particles/index.js +++ b/src/particles/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.mesh + * @namespace PIXI.particles */ module.exports = { ParticleContainer: require('./ParticleContainer'), diff --git a/src/prepare/canvas/CanvasPrepare.js b/src/prepare/canvas/CanvasPrepare.js index 1a7fedf..89eb104 100644 --- a/src/prepare/canvas/CanvasPrepare.js +++ b/src/prepare/canvas/CanvasPrepare.js @@ -7,18 +7,21 @@ * @memberof PIXI * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer */ -function Prepare() +function CanvasPrepare() { } -Prepare.prototype.constructor = Prepare; -module.exports = Prepare; +CanvasPrepare.prototype.constructor = CanvasPrepare; +module.exports = CanvasPrepare; /** * Stub method for upload. - * @method upload + * @param {Function|PIXI.DisplayObject|PIXI.Container} item Either + * the container or display object to search for items to upload or + * the callback function, if items have been added using `prepare.add`. + * @param {Function} done When completed */ -Prepare.prototype.upload = function(displayObject, done) +CanvasPrepare.prototype.upload = function(displayObject, done) { if (typeof displayObject === 'function') { @@ -30,29 +33,27 @@ /** * Stub method for registering hooks. - * @method upload + * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. */ -Prepare.prototype.register = function() +CanvasPrepare.prototype.register = function() { return this; }; /** * Stub method for adding items. - * @method upload + * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. */ -Prepare.prototype.add = function() +CanvasPrepare.prototype.add = function() { return this; }; /** * Stub method for destroying plugin. - * @method destroy */ -Prepare.prototype.destroy = function() +CanvasPrepare.prototype.destroy = function() { - }; -core.CanvasRenderer.registerPlugin('prepare', Prepare); \ No newline at end of file +core.CanvasRenderer.registerPlugin('prepare', CanvasPrepare); \ No newline at end of file diff --git a/src/accessibility/AccessibilityManager.js b/src/accessibility/AccessibilityManager.js index f405467..24d8ad6 100644 --- a/src/accessibility/AccessibilityManager.js +++ b/src/accessibility/AccessibilityManager.js @@ -81,7 +81,9 @@ this.children = []; /** - * pre bind the functions.. + * pre-bind the functions + * + * @private */ this._onKeyDown = this._onKeyDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); diff --git a/src/accessibility/index.js b/src/accessibility/index.js index 4dd63ff..f69d612 100644 --- a/src/accessibility/index.js +++ b/src/accessibility/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.interaction + * @namespace PIXI.AccessibilityManager */ module.exports = { accessibleTarget: require('./accessibleTarget'), diff --git a/src/core/Shader.js b/src/core/Shader.js index 5022a73..1fa984d 100644 --- a/src/core/Shader.js +++ b/src/core/Shader.js @@ -22,7 +22,7 @@ * * @class * @memberof PIXI - * @param gl {WebGLRenderingContext} + * @param gl {WebGLRenderingContext} The current WebGL rendering context * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 90575c7..7992d77 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -179,8 +179,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {PIXI.DisplayObject} - * @param child2 {PIXI.DisplayObject} + * @param child {PIXI.DisplayObject} First display object to swap + * @param child2 {PIXI.DisplayObject} Second display object to swap */ Container.prototype.swapChildren = function (child, child2) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 54a4017..11db2a9 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -25,6 +25,8 @@ /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! + * + * @member {PIXI.Transform|PIXI.TransformStatic} */ this.transform = new TransformClass(); @@ -55,7 +57,7 @@ * The display object container that contains this display object. * * @member {PIXI.Container} - * @readOnly + * @readonly */ this.parent = null; @@ -63,7 +65,7 @@ * The multiplied alpha of the displayObject * * @member {number} - * @readOnly + * @readonly */ this.worldAlpha = 1; @@ -147,7 +149,7 @@ * Current transform of the object based on world (parent) factors * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ worldTransform: { get: function () @@ -160,7 +162,7 @@ * Current transform of the object based on local factors: position, scale, other stuff * * @member {PIXI.Matrix} - * @readOnly + * @readonly */ localTransform: { get: function () @@ -172,7 +174,7 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ position: { get: function() @@ -187,7 +189,7 @@ /** * The scale factor of the object. * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ scale: { get: function() { @@ -201,7 +203,7 @@ /** * The pivot point of the displayObject that it rotates around * - * @member {PIXI.Point} + * @member {PIXI.Point|PIXI.ObservablePoint} */ pivot: { get: function() { @@ -215,7 +217,7 @@ /** * The skew factor for the object in radians. * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ skew: { get: function() { @@ -440,8 +442,8 @@ /** * Set the parent Container of this DisplayObject * - * @param container {Container} The Container to add this DisplayObject to - * @return {Container} The Container that this DisplayObject was added to + * @param container {PIXI.Container} The Container to add this DisplayObject to + * @return {PIXI.Container} The Container that this DisplayObject was added to */ DisplayObject.prototype.setParent = function (container) { @@ -466,7 +468,7 @@ * @param [skewY=0] {number} The Y skew value * @param [pivotX=0] {number} The X pivot value * @param [pivotY=0] {number} The Y pivot value - * @return {PIXI.DisplayObject} + * @return {PIXI.DisplayObject} The DisplayObject instance */ DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { diff --git a/src/core/display/Transform.js b/src/core/display/Transform.js index ee8bafb..e08c2f0 100644 --- a/src/core/display/Transform.js +++ b/src/core/display/Transform.js @@ -33,7 +33,11 @@ */ this.scale = new math.Point(1,1); - + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ this.skew = new math.ObservablePoint(this.updateSkew, this, 0,0); /** @@ -48,8 +52,10 @@ * The rotation value of the object, in radians * * @member {Number} + * @private */ this._rotation = 0; + this._sr = Math.sin(0); this._cr = Math.cos(0); this._cy = Math.cos(0);//skewY); @@ -75,8 +81,7 @@ /** * Updates the values of the object and applies the parent's transform. - * @param parentTransform {PIXI.Transform} The transform of the parent of this object - * + * @param parentTransform {PIXI.Transform} The transform of the parent of this object */ Transform.prototype.updateTransform = function (parentTransform) { @@ -112,7 +117,7 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ Transform.prototype.setFromMatrix = function (matrix) { @@ -125,6 +130,7 @@ * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.Transform# */ rotation: { get: function () { diff --git a/src/core/display/TransformStatic.js b/src/core/display/TransformStatic.js index 510b716..d0d822d 100644 --- a/src/core/display/TransformStatic.js +++ b/src/core/display/TransformStatic.js @@ -132,20 +132,19 @@ /** * Decomposes a matrix and sets the transforms properties based on it. - * @param {Matrix} + * @param {PIXI.Matrix} The matrix to decompose */ TransformStatic.prototype.setFromMatrix = function (matrix) { matrix.decompose(this); }; - - Object.defineProperties(TransformStatic.prototype, { /** * The rotation of the object in radians. * * @member {number} + * @memberof PIXI.TransformStatic# */ rotation: { get: function () { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index ffe0009..15ce884 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -177,7 +177,7 @@ * Creates a new Graphics object with the same values as this one. * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} A clone of the graphics object */ Graphics.prototype.clone = function () { @@ -214,7 +214,7 @@ * @param lineWidth {number} width of the line to draw, will update the objects stored style * @param color {number} color of the line to draw, will update the objects stored style * @param alpha {number} alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -248,8 +248,8 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {PIXI.Graphics} - */ + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ Graphics.prototype.moveTo = function (x, y) { var shape = new math.Polygon([x,y]); @@ -265,7 +265,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.lineTo = function (x, y) { @@ -283,7 +283,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -339,7 +339,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -379,7 +379,7 @@ * @param x2 {number} The x-coordinate of the end of the arc * @param y2 {number} The y-coordinate of the end of the arc * @param radius {number} The radius of the arc - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -445,8 +445,8 @@ * @param radius {number} The radius of the circle * @param startAngle {number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) * @param endAngle {number} The ending angle, in radians - * @param anticlockwise {boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {PIXI.Graphics} + * @param [anticlockwise=false] {boolean} Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -523,7 +523,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.beginFill = function (color, alpha) { @@ -546,7 +546,7 @@ /** * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @return {Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.endFill = function () { @@ -563,7 +563,7 @@ * @param y {number} The Y coord of the top-left of the rectangle * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -579,7 +579,7 @@ * @param width {number} The width of the rectangle * @param height {number} The height of the rectangle * @param radius {number} Radius of the rectangle corners - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -594,7 +594,7 @@ * @param x {number} The X coordinate of the center of the circle * @param y {number} The Y coordinate of the center of the circle * @param radius {number} The radius of the circle - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -610,7 +610,7 @@ * @param y {number} The Y coordinate of the center of the ellipse * @param width {number} The half width of the ellipse * @param height {number} The half height of the ellipse - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -623,7 +623,7 @@ * Draws a polygon using the given path. * * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.drawPolygon = function (path) { @@ -662,7 +662,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {PIXI.Graphics} + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ Graphics.prototype.clear = function () { diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 43a47b2..794bb1c 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -22,10 +22,12 @@ * @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 */ @@ -51,7 +53,6 @@ */ this.fill = fill; - this.holes = []; /* @@ -71,7 +72,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {PIXI.GraphicsData} + * @return {PIXI.GraphicsData} Cloned GraphicsData object */ GraphicsData.prototype.clone = function () { @@ -86,6 +87,10 @@ ); }; +/** + * + * + */ GraphicsData.prototype.addHole = function (shape) { this.holes.push(shape); diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 5fb6442..0c9e637 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -196,8 +196,8 @@ /** * Translates the matrix on the x and y. * - * @param {number} x - * @param {number} y + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) @@ -280,15 +280,15 @@ /** * Sets the matrix based on all the available properties * - * @param {number} x - * @param {number} y - * @param {number} pivotX - * @param {number} pivotY - * @param {number} scaleX - * @param {number} scaleY - * @param {number} rotation - * @param {number} skewX - * @param {number} skewY + * @param {number} x Position on the x axis + * @param {number} y Position on the y axis + * @param {number} pivotX Pivot on the x axis + * @param {number} pivotY Pivot on the y axis + * @param {number} scaleX Scale on the x axis + * @param {number} scaleY Scale on the y axis + * @param {number} rotation Rotation in radians + * @param {number} skewX Skew on the x axis + * @param {number} skewY Skew on the y axis * * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ @@ -347,8 +347,8 @@ /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * @param {Transform} the transform to apply the properties to. - * @return {Transform} The transform with the newly applied properies + * @param transform {PIXI.Transform} the transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properies */ Matrix.prototype.decompose = function(transform) { diff --git a/src/core/math/ObservablePoint.js b/src/core/math/ObservablePoint.js index 836fcdd..1dc1c27 100644 --- a/src/core/math/ObservablePoint.js +++ b/src/core/math/ObservablePoint.js @@ -87,7 +87,7 @@ /** * Copies the data from another point * - * @param point {PIXI.Point|{PIXI.ObservablePoint} point to copy from + * @param point {PIXI.Point|PIXI.ObservablePoint} point to copy from */ ObservablePoint.prototype.copy = function (point) { diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 8202a6f..9e1da91 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -48,7 +48,7 @@ * Returns true if the given point is equal to this point * * @param p {PIXI.Point} - * @returns {boolean} + * @returns {boolean} Whether the given point equal to this point */ Point.prototype.equals = function (p) { return (p.x === this.x) && (p.y === this.y); diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index a4794a4..9cf2267 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -34,6 +34,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.CIRC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.CIRC; } diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index d1d1d79..bde51b0 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -41,6 +41,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.ELIP + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.ELIP; } diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index ab0f950..df9fcb5 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -53,6 +53,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.POLY + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.POLY; } diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 128a7b7..989db92 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -40,6 +40,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readOnly + * @default CONST.SHAPES.RECT + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RECT; } diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 781bb2b..0d76457 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -47,6 +47,9 @@ * The type of the object, mainly used to avoid `instanceof` checks * * @member {number} + * @readonly + * @default CONST.SHAPES.RREC + * @see PIXI.SHAPES */ this.type = CONST.SHAPES.RREC; } diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 1264abe..de371c7 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -242,14 +242,16 @@ }; /** + * Resizes the canvas view to the specified width and height. + * * @extends PIXI.SystemRenderer#resize * - * @param {number} w - * @param {number} h + * @param width {number} The new width of the canvas view + * @param height {number} The new height of the canvas view */ -CanvasRenderer.prototype.resize = function (w, h) +CanvasRenderer.prototype.resize = function (width, height) { - SystemRenderer.prototype.resize.call(this, w, h); + SystemRenderer.prototype.resize.call(this, width, height); //reset the scale mode.. oddly this seems to be reset when the canvas is resized. //surely a browser bug?? Let pixi fix that for you.. diff --git a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js index ecb384f..030d258 100644 --- a/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js +++ b/src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js @@ -2,11 +2,12 @@ canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes'); /** - * Maps gl blend combinations to WebGL + * Maps blend combinations to Canvas * @class * @memberof PIXI + * @param array */ -function mapWebGLBlendModesToPixi(array) +function mapCanvasBlendModesToPixi(array) { array = array || []; @@ -55,4 +56,4 @@ return array; } -module.exports = mapWebGLBlendModesToPixi; +module.exports = mapCanvasBlendModesToPixi; diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index b4093da..5472d01 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -8,7 +8,7 @@ * * @class * @memberof PIXI - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ var TextureManager = function(renderer) { @@ -139,9 +139,9 @@ * Deletes the texture from WebGL * * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy - * @param [_skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. + * @param [skipRemove=false] {boolean} Whether to skip removing the texture from the TextureManager. */ -TextureManager.prototype.destroyTexture = function(texture, _skipRemove) +TextureManager.prototype.destroyTexture = function(texture, skipRemove) { texture = texture.baseTexture || texture; @@ -159,7 +159,7 @@ delete texture._glTextures[this.renderer.CONTEXT_UID]; - if (!_skipRemove) + if (!skipRemove) { var i = this._managedTextures.indexOf(texture); if (i !== -1) { diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index d2e03b6..894c3e9 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -48,8 +48,8 @@ /** * The type of this renderer as a standardised const * - * @member {number}// - * + * @member {number} + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.WEBGL; @@ -203,14 +203,13 @@ * * @param displayObject {PIXI.DisplayObject} the object to be rendered * @param renderTexture {PIXI.RenderTexture} - * @param clear {boolean} - * @param transform {PIXI.Transform} - * @param skipUpdateTransform {boolean} + * @param [clear] {boolean} Should the canvas be cleared before the new render + * @param [transform] {PIXI.Transform} + * @param [skipUpdateTransform] {boolean} */ WebGLRenderer.prototype.render = function (displayObject, renderTexture, clear, transform, skipUpdateTransform) { - // can be handy to know! this.renderingToScreen = !renderTexture; diff --git a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js index cd1edfc..7f5f0fd 100644 --- a/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js @@ -7,7 +7,7 @@ * The SpriteMaskFilter class * * @class - * @extends PIXI.AbstractFilter + * @extends PIXI.Filter * @memberof PIXI * @param sprite {PIXI.Sprite} the target sprite */ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 62a2ff0..6aa6d83 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -28,7 +28,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to push the mask to * @param maskData {Array<*>} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -67,7 +67,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {PIXI.DisplayObject} + * @param target {PIXI.DisplayObject} Display Object to pop the mask from * @param maskData {Array<*>} */ MaskManager.prototype.popMask = function (target, maskData) @@ -93,8 +93,8 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {PIXI.RenderTarget} - * @param maskData {PIXI.Sprite} + * @param target {PIXI.RenderTarget} Display Object to push the sprite mask to + * @param maskData {PIXI.Sprite} Sprite to be used as the mask */ MaskManager.prototype.pushSpriteMask = function (target, maskData) { @@ -147,6 +147,11 @@ this.renderer.stencilManager.popStencil(); }; +/** + * + * @param target {PIXI.RenderTarget} Display Object to push the scissor mask to + * @param maskData + */ MaskManager.prototype.pushScissorMask = function (target, maskData) { maskData.renderable = true; @@ -171,6 +176,10 @@ this.scissor = true; }; +/** + * + * + */ MaskManager.prototype.popScissorMask = function () { this.scissorRenderTarget = null; diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index 4b9ae57..186ba88 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -37,7 +37,7 @@ }; /** - * flushes + * Stub method for rendering content and emptying the current batch. * */ ObjectRenderer.prototype.flush = function () diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 91a833c..e6eb1d0 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -12,7 +12,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param [width=0] {number} the horizontal range of the filter * @param [height=0] {number} the vertical range of the filter - * @param [scaleMode=CONST.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The current resolution / device pixel ratio * @param [root=false] {boolean} Whether this object is the root element or not */ diff --git a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js index 2e3a2d6..a811504 100644 --- a/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js @@ -4,6 +4,8 @@ * Maps gl blend combinations to WebGL * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param array */ function mapWebGLBlendModesToPixi(gl, array) { diff --git a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js index 2db5f68..ed196f7 100644 --- a/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js +++ b/src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js @@ -4,6 +4,8 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param gl {WebGLRenderingContext} The current WebGL drawing context + * @param object */ function mapWebGLDrawModesToPixi(gl, object) { diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 6a60a81..65367f2 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -29,7 +29,7 @@ * Setting the anchor to 0.5,0.5 means the texture's origin is centered * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} */ this.anchor = new math.ObservablePoint(this.onAnchorUpdate, this); @@ -497,11 +497,11 @@ /** * Helper function that creates a new sprite based on the source you provide. - * The soucre can be - frame id, image url, video url, canvae element, video element, base texture + * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Sprite.from = function (source) { diff --git a/src/core/sprites/canvas/CanvasTinter.js b/src/core/sprites/canvas/CanvasTinter.js index 14f2c33..e5f8d9f 100644 --- a/src/core/sprites/canvas/CanvasTinter.js +++ b/src/core/sprites/canvas/CanvasTinter.js @@ -10,6 +10,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * + * @memberof! PIXI.CanvasTinter# * @param sprite {PIXI.Sprite} the sprite to tint * @param color {number} the color to use to tint the sprite with * @return {HTMLCanvasElement} The tinted canvas @@ -56,6 +57,7 @@ /** * Tint a texture using the 'multiply' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -70,7 +72,7 @@ crop.y *= resolution; crop.width *= resolution; crop.height *= resolution; - + canvas.width = crop.width; canvas.height = crop.height; @@ -110,6 +112,7 @@ /** * Tint a texture using the 'overlay' operation. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -151,6 +154,7 @@ /** * Tint a texture pixel per pixel. * + * @memberof! PIXI.CanvasTinter# * @param texture {PIXI.Texture} the texture to tint * @param color {number} the color to use to tint the sprite with * @param canvas {HTMLCanvasElement} the current canvas @@ -202,6 +206,7 @@ /** * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. * + * @memberof! PIXI.CanvasTinter# * @param color {number} the color to round, should be a hex color */ CanvasTinter.roundColor = function (color) @@ -220,21 +225,21 @@ /** * Number of steps which will be used as a cap when rounding colors. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.cacheStepsPerColorChannel = 8; /** * Tint cache boolean flag. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.convertTintToImage = false; /** * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. * - * @member CanvasTinter + * @memberof! PIXI.CanvasTinter# */ CanvasTinter.canUseMultiply = canUseNewCanvasBlendModes(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 7eaaa36..b9d6e0b 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -139,7 +139,7 @@ /** * Set the style of the text. Set up an event listener to listen for changes on the style object and mark the text as dirty. * - * @param [style] {object|PIXI.TextStyle} The style parameters + * @member {object|PIXI.TextStyle} * @memberof PIXI.Text# */ style: { @@ -171,7 +171,7 @@ /** * Set the copy for the text object. To split a line you can use '\n'. * - * @param text {string} The copy that you would like the text to display + * @member {string} * @memberof PIXI.Text# */ text: { @@ -346,7 +346,10 @@ /** * Render the text with letter-spacing. - * + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} isStroke - Is this drawing for the outside stroke of the text? If not, it's for the inside fill * @private */ Text.prototype.drawLetterSpacing = function(text, x, y, isStroke) @@ -424,7 +427,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer */ Text.prototype.renderWebGL = function (renderer) { @@ -436,7 +439,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {PIXI.CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Text.prototype._renderCanvas = function (renderer) @@ -449,7 +452,8 @@ /** * Calculates the ascent, descent and fontSize of a given fontStyle * - * @param fontStyle {object} + * @param fontStyle {string} String representing the style of the font + * @return {Object} Font properties object * @private */ Text.prototype.determineFontProperties = function (fontStyle) @@ -552,7 +556,8 @@ * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * - * @param text {string} + * @param text {string} String to apply word wrapping to + * @return {string} New string with new lines applied where required * @private */ Text.prototype.wordWrap = function (text) diff --git a/src/core/text/TextStyle.js b/src/core/text/TextStyle.js index ce6716b..0c4cbbf 100644 --- a/src/core/text/TextStyle.js +++ b/src/core/text/TextStyle.js @@ -79,7 +79,7 @@ * Creates a new TextStyle object with the same values as this one. * Note that the only the properties of the object are cloned, not its event emitter. * - * @return {PIXI.TextStyle} + * @return {PIXI.TextStyle} New cloned TextStyle object */ TextStyle.prototype.clone = function () { diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 07f358f..f61829a 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -42,7 +42,7 @@ * @memberof PIXI * @param [width=100] {number} The width of the base render texture * @param [height=100] {number} The height of the base render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ function BaseRenderTexture(width, height, scaleMode, resolution) @@ -73,6 +73,8 @@ this._canvasRenderTarget = null; /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = false; diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index 0811c30..9f9bc03 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -33,7 +33,7 @@ * The width of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.width = 100; @@ -41,7 +41,7 @@ * The height of the base texture set when the image has loaded * * @member {number} - * @readOnly + * @readonly */ this.height = 100; @@ -51,14 +51,14 @@ * Used to store the actual width of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realWidth = 100; /** * Used to store the actual height of the source of this texture * * @member {number} - * @readOnly + * @readonly */ this.realHeight = 100; @@ -77,7 +77,7 @@ * This is never true if the underlying source fails to load or has no texture data. * * @member {boolean} - * @readOnly + * @readonly */ this.hasLoaded = false; @@ -113,6 +113,8 @@ this.premultipliedAlpha = true; /** + * The image url of the texture + * * @member {string} */ this.imageUrl = null; @@ -132,6 +134,7 @@ * Also the texture must be a power of two size to work * * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES */ this.mipmap = CONST.MIPMAP_TEXTURES; @@ -139,7 +142,8 @@ * * WebGL Texture wrap mode * - * @member {boolean} + * @member {number} + * @see PIXI.WRAP_MODES */ this.wrapMode = CONST.WRAP_MODES.DEFAULT; @@ -207,11 +211,9 @@ * * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: * - * if (texture.hasLoaded) - { + * if (texture.hasLoaded) { * // texture ready for use - * } else if (texture.isLoading) - { + * } else if (texture.isLoading) { * // listen to 'loaded' and/or 'error' events on texture * } else { * // not loading, not going to load UNLESS the source is reloaded diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index e9976f4..3dea237 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -72,6 +72,8 @@ ); /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * * @member {boolean} */ this.valid = true; @@ -111,7 +113,7 @@ * A short hand way of creating a render texture.. * @param [width=100] {number} The width of the render texture * @param [height=100] {number} The height of the render texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution / device pixel ratio of the texture being generated */ RenderTexture.create = function(width, height, scaleMode, resolution) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74c2699..e17010a 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -346,7 +346,7 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin] {boolean} Whether requests should be treated as crossorigin - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) @@ -387,8 +387,8 @@ * * @static * @param canvas {HTMLCanvasElement} The canvas element source of the texture - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -400,8 +400,8 @@ * * @static * @param video {HTMLVideoElement|string} The URL or actual element of the video - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideo = function (video, scaleMode) { @@ -419,9 +419,9 @@ * Helper function that creates a new Texture based on the video url. * * @static - * @param videoUrl {string} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} A Texture + * @param videoUrl {string} URL of the video + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -433,8 +433,8 @@ * The soucre can be - frame id, image url, video url, canvae element, video element, base texture * * @static - * @param source {} - * @return {PIXI.Texture} A Texture + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture */ Texture.from = function (source) { diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index d74b2e7..35e6ab0 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -26,8 +26,8 @@ * @class * @extends PIXI.BaseTexture * @memberof PIXI - * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values + * @param source {HTMLVideoElement} Video source + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -159,9 +159,9 @@ * Mimic Pixi BaseTexture.from.... method. * * @static - * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @param video {HTMLVideoElement} Video to create texture from + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -191,7 +191,7 @@ * @param [videoSrc.mime] {string} The mimetype of the video (e.g. 'video/mp4'). If not specified * the url's extension will be used as the second part of the mime type. * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.VideoBaseTexture} + * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 7a80907..690626e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -236,7 +236,7 @@ * * @param fn {Function} The listener function to be added for updates * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.add = function add(fn, context) { @@ -254,7 +254,7 @@ * * @param fn {Function} The listener function to be added for one update * @param [context] {Function} The listener context - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.addOnce = function addOnce(fn, context) { @@ -272,7 +272,7 @@ * * @param [fn] {Function} The listener function to be removed * @param [context] {Function} The listener context to be removed - * @returns {PIXI.ticker.Ticker} this + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ Ticker.prototype.remove = function remove(fn, context) { diff --git a/src/core/utils/createIndicesForQuads.js b/src/core/utils/createIndicesForQuads.js index d46824b..878dd0f 100644 --- a/src/core/utils/createIndicesForQuads.js +++ b/src/core/utils/createIndicesForQuads.js @@ -2,8 +2,9 @@ * Generic Mask Stack data structure * @class * @memberof PIXI + * @param size {number} Number of quads + * @return {Uint16Array} indices */ - var createIndicesForQuads = function (size) { // the total number of indices in our array, there are 6 points per quad. diff --git a/src/core/utils/index.js b/src/core/utils/index.js index f87ce18..670d844 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -13,6 +13,7 @@ /** * Gets the next unique identifier * + * @memberof PIXI.utils * @return {number} The next unique identifier to use. */ uid: function () @@ -23,8 +24,9 @@ /** * Converts a hex color number to an [R, G, B] array * + * @memberof PIXI.utils * @param hex {number} - * @param {number[]} [out=[]] + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one * @return {number[]} An array representing the [R, G, B] of the color. */ hex2rgb: function (hex, out) @@ -41,7 +43,8 @@ /** * Converts a hex color number to a string. * - * @param hex {number} + * @memberof PIXI.utils + * @param hex {number} Number in hex * @return {string} The string color. */ hex2string: function (hex) @@ -55,7 +58,8 @@ /** * Converts a color as an [R, G, B] array to a hex number * - * @param rgb {number[]} + * @memberof PIXI.utils + * @param rgb {number[]} rgb array * @return {number} The color number */ rgb2hex: function (rgb) @@ -68,8 +72,9 @@ * get the resolution / device pixel ratio of an asset by looking for the prefix * used by spritesheets and image urls * + * @memberof PIXI.utils * @param url {string} the image path - * @return {number} + * @return {number} resolution / device pixel ratio of an asset */ getResolutionOfUrl: function (url) { @@ -89,6 +94,7 @@ * so the library thinks it already said it. Keep in mind that doing that will forever * makes you a jerk face. * + * @memberof PIXI.utils * @param {string} type - The string renderer type to log. * @constant * @static @@ -128,7 +134,8 @@ /** * Helper for checking for webgl support * - * @return {boolean} + * @memberof PIXI.utils + * @return {boolean} is webgl supported */ isWebGLSupported: function () { @@ -166,6 +173,7 @@ /** * Returns sign of number * + * @memberof PIXI.utils * @param n {number} * @returns {number} 0 if n is 0, -1 if n is negative, 1 if n i positive */ @@ -175,8 +183,9 @@ }, /** - * removeItems + * Remove a range of items from an array * + * @memberof PIXI.utils * @param {Array<*>} arr The target array * @param {number} startIdx The index to begin removing from (inclusive) * @param {number} removeCount How many items to remove @@ -201,12 +210,16 @@ /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ TextureCache: {}, /** * @todo Describe property usage + * + * @memberof PIXI.utils * @private */ BaseTextureCache: {} diff --git a/src/deprecation.js b/src/deprecation.js index 1a3c76f..1027dbc 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -522,6 +522,12 @@ return core.utils.uid(); }; +/** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + */ core.utils.canUseNewCanvasBlendModes = function() { warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); return core.CanvasTinter.canUseMultiply; diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index b751e17..67c8556 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -20,8 +20,8 @@ /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ CanvasExtract.prototype.image = function ( target ) { @@ -96,7 +96,7 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ CanvasExtract.prototype.pixels = function ( target ) { diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 2c25b64..0ef829d 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -5,25 +5,25 @@ * The extract manager provides functionality to export content from the renderers * @class * @memberof PIXI - * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer + * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Extract(renderer) +function WebGLExtract(renderer) { this.renderer = renderer; renderer.extract = this; } -Extract.prototype.constructor = Extract; -module.exports = Extract; +WebGLExtract.prototype.constructor = WebGLExtract; +module.exports = WebGLExtract; /** * Will return a HTML Image of the target * - * @return {Image} * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer + * @return {Image} HTML Image of the target */ -Extract.prototype.image = function ( target ) +WebGLExtract.prototype.image = function ( target ) { var image = new Image(); image.src = this.base64( target ); @@ -35,7 +35,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {string} A base64 encoded string of the texture. */ -Extract.prototype.base64 = function ( target ) +WebGLExtract.prototype.base64 = function ( target ) { return this.canvas( target ).toDataURL(); }; @@ -45,7 +45,7 @@ * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer * @return {HTMLCanvasElement} A Canvas element with the texture rendered on. */ -Extract.prototype.canvas = function ( target ) +WebGLExtract.prototype.canvas = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -126,9 +126,9 @@ /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included). * @param target {PIXI.DisplayObject|PIXI.RenderTexture} A displayObject or renderTexture to convert. If left empty will use use the main renderer - * @return {Uint8ClampedArray} + * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture */ -Extract.prototype.pixels = function ( target ) +WebGLExtract.prototype.pixels = function ( target ) { var renderer = this.renderer; var textureBuffer; @@ -186,10 +186,10 @@ * Destroys the extract * */ -Extract.prototype.destroy = function () +WebGLExtract.prototype.destroy = function () { this.renderer.extract = null; this.renderer = null; }; -core.WebGLRenderer.registerPlugin('extract', Extract); +core.WebGLRenderer.registerPlugin('extract', WebGLExtract); diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index dbe1c65..1f119f9 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -12,7 +12,6 @@ * var bitmapText = new PIXI.extras.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); * ``` * - * * http://www.angelcode.com/products/bmfont/ for windows or * http://www.bmglyph.com/ for mac. * @@ -40,7 +39,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textWidth = 0; @@ -49,7 +48,7 @@ * which is defined in the style object * * @member {number} - * @readOnly + * @readonly */ this.textHeight = 0; @@ -108,7 +107,7 @@ /** * Text anchor. read-only * - * @member {PIXI.Point} + * @member {PIXI.ObservablePoint} * @private */ this._anchor = new ObservablePoint(this.makeDirty, this, 0, 0); diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index b7ae916..ee77d9b 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -1,4 +1,12 @@ var core = require('../core'); + +/** + * @typedef PIXI.extras.MovieClip.FrameObject + * @type {object} + * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame + * @property time {number} the duration of the frame in ms + */ + /** * A MovieClip is a simple way to display an animation depicted by a list of textures. * @@ -15,15 +23,11 @@ * var mc = new PIXI.MovieClip(textureArray); * ``` * - * @typedef FrameObject - * @type {object} - * @property texture {PIXI.Texture} The {@link PIXI.Texture} of the frame - * @property time {number} the duration of the frame in ms * * @class * @extends PIXI.Sprite * @memberof PIXI.extras - * @param textures {PIXI.Texture[]|FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation + * @param textures {PIXI.Texture[]|PIXI.extras.MovieClip.FrameObject[]} an array of {@link PIXI.Texture} or frame objects that make up the animation */ function MovieClip(textures) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 9027b86..49176b5 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -113,7 +113,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {PIXI.WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -406,6 +406,7 @@ * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite + * @return {PIXI.extras.TilingSprite} A new TilingSprite */ TilingSprite.fromFrame = function (frameId,width,height) { diff --git a/src/filters/fxaa/FXAAFilter.js b/src/filters/fxaa/FXAAFilter.js index b2a77c7..9b5e8b4 100644 --- a/src/filters/fxaa/FXAAFilter.js +++ b/src/filters/fxaa/FXAAFilter.js @@ -7,9 +7,7 @@ * modification that the texture2DLod stuff was removed since it's * unsupported by WebGL. * - * -- - * From: - * https://github.com/mitsuhiko/webgl-meincraft + * @see https://github.com/mitsuhiko/webgl-meincraft * * @class * @extends PIXI.Filter diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 29757a5..0d9ba00 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -105,6 +105,7 @@ /** * @member {Function} + * @private */ this.onMouseUp = this.onMouseUp.bind(this); this.processMouseUp = this.processMouseUp.bind( this ); @@ -112,18 +113,21 @@ /** * @member {Function} + * @private */ this.onMouseDown = this.onMouseDown.bind(this); this.processMouseDown = this.processMouseDown.bind( this ); /** * @member {Function} + * @private */ this.onMouseMove = this.onMouseMove.bind( this ); this.processMouseMove = this.processMouseMove.bind( this ); /** * @member {Function} + * @private */ this.onMouseOut = this.onMouseOut.bind(this); this.processMouseOverOut = this.processMouseOverOut.bind( this ); @@ -131,28 +135,26 @@ /** * @member {Function} + * @private */ this.onTouchStart = this.onTouchStart.bind(this); this.processTouchStart = this.processTouchStart.bind(this); /** * @member {Function} + * @private */ this.onTouchEnd = this.onTouchEnd.bind(this); this.processTouchEnd = this.processTouchEnd.bind(this); /** * @member {Function} + * @private */ this.onTouchMove = this.onTouchMove.bind(this); this.processTouchMove = this.processTouchMove.bind(this); /** - * @member {number} - */ - this.last = 0; - - /** * Every update cursor will be reset to this value, if some element wont override it in its hitTest * @member {string} * @default 'inherit' @@ -279,7 +281,7 @@ * Invoked by a throttled ticker update from * {@link PIXI.ticker.shared}. * - * @param deltaTime {number} + * @param deltaTime {number} time delta since last tick */ InteractionManager.prototype.update = function (deltaTime) { @@ -750,6 +752,7 @@ * Is called when a touch ends on the renderer element * * @param event {Event} The DOM event of a touch ending on the renderer view + * @private */ InteractionManager.prototype.onTouchEnd = function (event) { diff --git a/src/loaders/loader.js b/src/loaders/loader.js index 07ca093..dbce851 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -24,6 +24,7 @@ * @memberof PIXI.loaders * @param [baseUrl=''] {string} The base url for all resources loaded by this loader. * @param [concurrency=10] {number} The number of resources to load concurrently. + * @see https://github.com/englercj/resource-loader */ function Loader(baseUrl, concurrency) { diff --git a/src/mesh/webgl/MeshShader.js b/src/mesh/webgl/MeshShader.js index dda3e46..3ea61c3 100644 --- a/src/mesh/webgl/MeshShader.js +++ b/src/mesh/webgl/MeshShader.js @@ -4,7 +4,7 @@ * @class * @extends PIXI.Shader * @memberof PIXI.mesh - * @param gl {Shader} TODO: Find a good explanation for this. + * @param gl {PIXI.Shader} TODO: Find a good explanation for this. */ function MeshShader(gl) { diff --git a/src/particles/index.js b/src/particles/index.js index 4a93acb..68d4dc7 100644 --- a/src/particles/index.js +++ b/src/particles/index.js @@ -6,7 +6,7 @@ */ /** - * @namespace PIXI.mesh + * @namespace PIXI.particles */ module.exports = { ParticleContainer: require('./ParticleContainer'), diff --git a/src/prepare/canvas/CanvasPrepare.js b/src/prepare/canvas/CanvasPrepare.js index 1a7fedf..89eb104 100644 --- a/src/prepare/canvas/CanvasPrepare.js +++ b/src/prepare/canvas/CanvasPrepare.js @@ -7,18 +7,21 @@ * @memberof PIXI * @param renderer {PIXI.CanvasRenderer} A reference to the current renderer */ -function Prepare() +function CanvasPrepare() { } -Prepare.prototype.constructor = Prepare; -module.exports = Prepare; +CanvasPrepare.prototype.constructor = CanvasPrepare; +module.exports = CanvasPrepare; /** * Stub method for upload. - * @method upload + * @param {Function|PIXI.DisplayObject|PIXI.Container} item Either + * the container or display object to search for items to upload or + * the callback function, if items have been added using `prepare.add`. + * @param {Function} done When completed */ -Prepare.prototype.upload = function(displayObject, done) +CanvasPrepare.prototype.upload = function(displayObject, done) { if (typeof displayObject === 'function') { @@ -30,29 +33,27 @@ /** * Stub method for registering hooks. - * @method upload + * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. */ -Prepare.prototype.register = function() +CanvasPrepare.prototype.register = function() { return this; }; /** * Stub method for adding items. - * @method upload + * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. */ -Prepare.prototype.add = function() +CanvasPrepare.prototype.add = function() { return this; }; /** * Stub method for destroying plugin. - * @method destroy */ -Prepare.prototype.destroy = function() +CanvasPrepare.prototype.destroy = function() { - }; -core.CanvasRenderer.registerPlugin('prepare', Prepare); \ No newline at end of file +core.CanvasRenderer.registerPlugin('prepare', CanvasPrepare); \ No newline at end of file diff --git a/src/prepare/webgl/WebGLPrepare.js b/src/prepare/webgl/WebGLPrepare.js index 802e456..74495b8 100644 --- a/src/prepare/webgl/WebGLPrepare.js +++ b/src/prepare/webgl/WebGLPrepare.js @@ -7,7 +7,7 @@ * @memberof PIXI * @param renderer {PIXI.WebGLRenderer} A reference to the current renderer */ -function Prepare(renderer) +function WebGLPrepare(renderer) { /** * Reference to the renderer. @@ -46,7 +46,7 @@ /** * If prepare is ticking (running). - * @type {Boolean} + * @type {boolean} * @private */ this.ticking = false; @@ -58,24 +58,23 @@ /** * The number of graphics or textures to upload to the GPU - * @property {int} UPLOADS_PER_FRAME + * @property {number} UPLOADS_PER_FRAME * @static * @default 4 */ -Prepare.UPLOADS_PER_FRAME = 4; +WebGLPrepare.UPLOADS_PER_FRAME = 4; -Prepare.prototype.constructor = Prepare; -module.exports = Prepare; +WebGLPrepare.prototype.constructor = WebGLPrepare; +module.exports = WebGLPrepare; /** * Upload all the textures and graphics to the GPU. - * @method upload * @param {Function|PIXI.DisplayObject|PIXI.Container} item Either * the container or display object to search for items to upload or * the callback function, if items have been added using `prepare.add`. * @param {Function} done When completed */ -Prepare.prototype.upload = function(item, done) +WebGLPrepare.prototype.upload = function(item, done) { if (typeof item === 'function') { @@ -93,7 +92,7 @@ // Get the items for upload from the display if (this.queue.length) { - this.numLeft = Prepare.UPLOADS_PER_FRAME; + this.numLeft = WebGLPrepare.UPLOADS_PER_FRAME; this.completes.push(done); if (!this.ticking) { @@ -109,10 +108,9 @@ /** * Handle tick update - * @method tick * @private */ -Prepare.prototype.tick = function() +WebGLPrepare.prototype.tick = function() { var i, len; @@ -140,7 +138,7 @@ // We're finished if (this.queue.length) { - this.numLeft = Prepare.UPLOADS_PER_FRAME; + this.numLeft = WebGLPrepare.UPLOADS_PER_FRAME; } else { @@ -157,14 +155,13 @@ /** * Adds hooks for finding and uploading items. - * @method register * @param {Function} [addHook] Function call that takes two parameters: `item:*, queue:Array` function must return `true` if it was able to add item to the queue. * @param {Function} [uploadHook] Function call that takes two parameters: `renderer:WebGLRenderer, item:*` and * function must return `true` if it was able to handle upload of item. - * @return {PIXI.webgl.Prepare} Instance of plugin for chaining. + * @return {PIXI.WebGLPrepare} Instance of plugin for chaining. */ -Prepare.prototype.register = function(addHook, uploadHook) +WebGLPrepare.prototype.register = function(addHook, uploadHook) { if (addHook) { @@ -179,11 +176,10 @@ /** * Manually add an item to the uploading queue. - * @method add - * @param {PIXI.DisplayObject|PIXI.Container|*} item - * @return {PIXI.webgl.Prepare} Instance of plugin for chaining. + * @param {PIXI.DisplayObject|PIXI.Container|*} item Object to add to the queue + * @return {PIXI.WebGLPrepare} Instance of plugin for chaining. */ -Prepare.prototype.add = function(item) +WebGLPrepare.prototype.add = function(item) { var i, len; @@ -210,9 +206,8 @@ /** * Destroys the plugin, don't use after this. - * @method destroy */ -Prepare.prototype.destroy = function() +WebGLPrepare.prototype.destroy = function() { if (this.ticking) { @@ -228,10 +223,9 @@ /** * Built-in hook to upload PIXI.Texture objects to the GPU - * @method uploadBaseTextures * @private * @param {*} item Item to check - * @return {Boolean} If item was uploaded. + * @return {boolean} If item was uploaded. */ function uploadBaseTextures(renderer, item) { @@ -245,10 +239,9 @@ /** * Built-in hook to upload PIXI.Graphics to the GPU - * @method uploadGraphics * @private * @param {*} item Item to check - * @return {Boolean} If item was uploaded. + * @return {boolean} If item was uploaded. */ function uploadGraphics(renderer, item) { @@ -262,11 +255,10 @@ /** * Built-in hook to find textures from Sprites - * @method findTextures * @private * @param {PIXI.DisplayObject} item Display object to check * @param {Array<*>} queue Collection of items to upload - * @return {Boolean} if a PIXI.Texture object was found. + * @return {boolean} if a PIXI.Texture object was found. */ function findBaseTextures(item, queue) { @@ -293,11 +285,10 @@ /** * Built-in hook to find graphics - * @method findGraphics * @private * @param {PIXI.DisplayObject} item Display object to check * @param {Array<*>} queue Collection of items to upload - * @return {Boolean} if a PIXI.Graphics object was found. + * @return {boolean} if a PIXI.Graphics object was found. */ function findGraphics(item, queue) { @@ -309,4 +300,4 @@ return false; } -core.WebGLRenderer.registerPlugin('prepare', Prepare); \ No newline at end of file +core.WebGLRenderer.registerPlugin('prepare', WebGLPrepare); \ No newline at end of file