diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/filters/twist/TwistFilter.js b/src/filters/twist/TwistFilter.js index acc1f82..4e95927 100644 --- a/src/filters/twist/TwistFilter.js +++ b/src/filters/twist/TwistFilter.js @@ -33,8 +33,8 @@ /** * This point describes the the offset of the twist. * - * @member {Point} - * @memberof TwistFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TwistFilter# */ offset: { get: function () @@ -51,7 +51,7 @@ * This radius of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ radius: { get: function () @@ -68,7 +68,7 @@ * This angle of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ angle: { get: function () diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/filters/twist/TwistFilter.js b/src/filters/twist/TwistFilter.js index acc1f82..4e95927 100644 --- a/src/filters/twist/TwistFilter.js +++ b/src/filters/twist/TwistFilter.js @@ -33,8 +33,8 @@ /** * This point describes the the offset of the twist. * - * @member {Point} - * @memberof TwistFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TwistFilter# */ offset: { get: function () @@ -51,7 +51,7 @@ * This radius of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ radius: { get: function () @@ -68,7 +68,7 @@ * This angle of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ angle: { get: function () diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index 6c3188c..9775971 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -11,14 +11,14 @@ /** * This point stores the global coords of where the touch/mouse event happened * - * @member {Point} + * @member {PIXI.Point} */ this.global = new core.Point(); /** * The target Sprite that was interacted with * - * @member {Sprite} + * @member {PIXI.Sprite} */ this.target = null; @@ -36,10 +36,10 @@ /** * This will return the local coordinates of the specified displayObject for this InteractionData * - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * param [globalPos] {Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject + * @param displayObject {PIXI.DisplayObject} The DisplayObject that you would like the local coords off + * @param [point] {PIXI.Point} A Point object in which to store the value, optional (otherwise will create a new point) + * param [globalPos] {PIXI.Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) + * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/filters/twist/TwistFilter.js b/src/filters/twist/TwistFilter.js index acc1f82..4e95927 100644 --- a/src/filters/twist/TwistFilter.js +++ b/src/filters/twist/TwistFilter.js @@ -33,8 +33,8 @@ /** * This point describes the the offset of the twist. * - * @member {Point} - * @memberof TwistFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TwistFilter# */ offset: { get: function () @@ -51,7 +51,7 @@ * This radius of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ radius: { get: function () @@ -68,7 +68,7 @@ * This angle of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ angle: { get: function () diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index 6c3188c..9775971 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -11,14 +11,14 @@ /** * This point stores the global coords of where the touch/mouse event happened * - * @member {Point} + * @member {PIXI.Point} */ this.global = new core.Point(); /** * The target Sprite that was interacted with * - * @member {Sprite} + * @member {PIXI.Sprite} */ this.target = null; @@ -36,10 +36,10 @@ /** * This will return the local coordinates of the specified displayObject for this InteractionData * - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * param [globalPos] {Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject + * @param displayObject {PIXI.DisplayObject} The DisplayObject that you would like the local coords off + * @param [point] {PIXI.Point} A Point object in which to store the value, optional (otherwise will create a new point) + * param [globalPos] {PIXI.Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) + * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 15659fa..b7b607a 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -14,7 +14,7 @@ * * @class * @memberof PIXI.interaction - * @param renderer {CanvasRenderer|WebGLRenderer} A reference to the current renderer + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} A reference to the current renderer * @param [options] {object} * @param [options.autoPreventDefault=true] {boolean} Should the manager automatically prevent default browser actions. * @param [options.interactionFrequency=10] {number} Frequency increases the interaction events will be checked. @@ -26,7 +26,7 @@ /** * The renderer this interaction manager works for. * - * @member {SystemRenderer} + * @member {PIXI.SystemRenderer} */ this.renderer = renderer; @@ -49,14 +49,14 @@ /** * The mouse data * - * @member {InteractionData} + * @member {PIXI.interaction.InteractionData} */ this.mouse = new InteractionData(); /** * An event data object to handle all the event tracking/dispatching * - * @member {EventData} + * @member {object} */ this.eventData = { stopped: false, @@ -71,7 +71,7 @@ /** * Tiny little interactiveData pool ! * - * @member {Array} + * @member {PIXI.interaction.InteractionData[]} */ this.interactiveDataPool = []; @@ -150,7 +150,7 @@ /** * Internal cached var - * @member {Point} + * @member {PIXI.Point} * @private */ this._tempPoint = new core.Point(); @@ -189,6 +189,7 @@ /** * Registers all the DOM events + * * @private */ InteractionManager.prototype.addEvents = function () @@ -221,6 +222,7 @@ /** * Removes all the DOM events that were previously registered + * * @private */ InteractionManager.prototype.removeEvents = function () @@ -298,9 +300,10 @@ /** * Dispatches an event on the display object that was interacted with - * @param displayObject {Container|Sprite|TilingSprite} the display object in question + * + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} the display object in question * @param eventString {string} the name of the event (e.g, mousedown) - * @param eventData {EventData} the event data object + * @param eventData {object} the event data object * @private */ InteractionManager.prototype.dispatchEvent = function ( displayObject, eventString, eventData ) @@ -323,7 +326,7 @@ * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The resulting value is stored in the point. * This takes into account the fact that the DOM element could be scaled and positioned anywhere on the screen. * - * @param {Point} point the point that the result will be stored in + * @param {PIXI.Point} point the point that the result will be stored in * @param {number} x the x coord of the position to map * @param {number} y the y coord of the position to map */ @@ -338,9 +341,9 @@ * This function is provides a neat way of crawling through the scene graph and running a specified function on all interactive objects it finds. * It will also take care of hit testing the interactive objects and passes the hit across in the function. * - * @param {Point} point the point that is tested for collision - * @param {Container|Sprite|TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) - * @param {function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function + * @param {PIXI.Point} point the point that is tested for collision + * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) + * @param {Function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function * @param {boolean} hitTest this indicates if the objects inside should be hit test against the point * @return {boolean} returns true if the displayObject hit the point */ @@ -430,7 +433,7 @@ /** * Processes the result of the mouse down check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the dispay object * @private */ @@ -470,7 +473,7 @@ /** * Processes the result of the mouse up check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -534,7 +537,7 @@ /** * Processes the result of the mouse move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -573,7 +576,7 @@ /** * Processes the result of the mouse over/out check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -639,7 +642,7 @@ /** * Processes the result of a touch check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -656,8 +659,8 @@ /** * Is called when a touch ends on the renderer element - * @param event {Event} The DOM event of a touch ending on the renderer view * + * @param event {Event} The DOM event of a touch ending on the renderer view */ InteractionManager.prototype.onTouchEnd = function (event) { @@ -691,7 +694,7 @@ /** * Processes the result of the end of a touch and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -753,7 +756,7 @@ /** * Processes the result of a touch move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -799,7 +802,7 @@ /** * Returns an interaction data object to the internal pool * - * @param touchData {InteractionData} The touch data object we want to return to the pool + * @param touchData {PIXI.interaction.InteractionData} The touch data object we want to return to the pool * * @private */ @@ -810,6 +813,7 @@ /** * Destroys the interaction manager + * */ InteractionManager.prototype.destroy = function () { this.removeEvents(); diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/filters/twist/TwistFilter.js b/src/filters/twist/TwistFilter.js index acc1f82..4e95927 100644 --- a/src/filters/twist/TwistFilter.js +++ b/src/filters/twist/TwistFilter.js @@ -33,8 +33,8 @@ /** * This point describes the the offset of the twist. * - * @member {Point} - * @memberof TwistFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TwistFilter# */ offset: { get: function () @@ -51,7 +51,7 @@ * This radius of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ radius: { get: function () @@ -68,7 +68,7 @@ * This angle of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ angle: { get: function () diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index 6c3188c..9775971 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -11,14 +11,14 @@ /** * This point stores the global coords of where the touch/mouse event happened * - * @member {Point} + * @member {PIXI.Point} */ this.global = new core.Point(); /** * The target Sprite that was interacted with * - * @member {Sprite} + * @member {PIXI.Sprite} */ this.target = null; @@ -36,10 +36,10 @@ /** * This will return the local coordinates of the specified displayObject for this InteractionData * - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * param [globalPos] {Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject + * @param displayObject {PIXI.DisplayObject} The DisplayObject that you would like the local coords off + * @param [point] {PIXI.Point} A Point object in which to store the value, optional (otherwise will create a new point) + * param [globalPos] {PIXI.Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) + * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 15659fa..b7b607a 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -14,7 +14,7 @@ * * @class * @memberof PIXI.interaction - * @param renderer {CanvasRenderer|WebGLRenderer} A reference to the current renderer + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} A reference to the current renderer * @param [options] {object} * @param [options.autoPreventDefault=true] {boolean} Should the manager automatically prevent default browser actions. * @param [options.interactionFrequency=10] {number} Frequency increases the interaction events will be checked. @@ -26,7 +26,7 @@ /** * The renderer this interaction manager works for. * - * @member {SystemRenderer} + * @member {PIXI.SystemRenderer} */ this.renderer = renderer; @@ -49,14 +49,14 @@ /** * The mouse data * - * @member {InteractionData} + * @member {PIXI.interaction.InteractionData} */ this.mouse = new InteractionData(); /** * An event data object to handle all the event tracking/dispatching * - * @member {EventData} + * @member {object} */ this.eventData = { stopped: false, @@ -71,7 +71,7 @@ /** * Tiny little interactiveData pool ! * - * @member {Array} + * @member {PIXI.interaction.InteractionData[]} */ this.interactiveDataPool = []; @@ -150,7 +150,7 @@ /** * Internal cached var - * @member {Point} + * @member {PIXI.Point} * @private */ this._tempPoint = new core.Point(); @@ -189,6 +189,7 @@ /** * Registers all the DOM events + * * @private */ InteractionManager.prototype.addEvents = function () @@ -221,6 +222,7 @@ /** * Removes all the DOM events that were previously registered + * * @private */ InteractionManager.prototype.removeEvents = function () @@ -298,9 +300,10 @@ /** * Dispatches an event on the display object that was interacted with - * @param displayObject {Container|Sprite|TilingSprite} the display object in question + * + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} the display object in question * @param eventString {string} the name of the event (e.g, mousedown) - * @param eventData {EventData} the event data object + * @param eventData {object} the event data object * @private */ InteractionManager.prototype.dispatchEvent = function ( displayObject, eventString, eventData ) @@ -323,7 +326,7 @@ * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The resulting value is stored in the point. * This takes into account the fact that the DOM element could be scaled and positioned anywhere on the screen. * - * @param {Point} point the point that the result will be stored in + * @param {PIXI.Point} point the point that the result will be stored in * @param {number} x the x coord of the position to map * @param {number} y the y coord of the position to map */ @@ -338,9 +341,9 @@ * This function is provides a neat way of crawling through the scene graph and running a specified function on all interactive objects it finds. * It will also take care of hit testing the interactive objects and passes the hit across in the function. * - * @param {Point} point the point that is tested for collision - * @param {Container|Sprite|TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) - * @param {function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function + * @param {PIXI.Point} point the point that is tested for collision + * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) + * @param {Function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function * @param {boolean} hitTest this indicates if the objects inside should be hit test against the point * @return {boolean} returns true if the displayObject hit the point */ @@ -430,7 +433,7 @@ /** * Processes the result of the mouse down check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the dispay object * @private */ @@ -470,7 +473,7 @@ /** * Processes the result of the mouse up check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -534,7 +537,7 @@ /** * Processes the result of the mouse move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -573,7 +576,7 @@ /** * Processes the result of the mouse over/out check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -639,7 +642,7 @@ /** * Processes the result of a touch check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -656,8 +659,8 @@ /** * Is called when a touch ends on the renderer element - * @param event {Event} The DOM event of a touch ending on the renderer view * + * @param event {Event} The DOM event of a touch ending on the renderer view */ InteractionManager.prototype.onTouchEnd = function (event) { @@ -691,7 +694,7 @@ /** * Processes the result of the end of a touch and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -753,7 +756,7 @@ /** * Processes the result of a touch move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -799,7 +802,7 @@ /** * Returns an interaction data object to the internal pool * - * @param touchData {InteractionData} The touch data object we want to return to the pool + * @param touchData {PIXI.interaction.InteractionData} The touch data object we want to return to the pool * * @private */ @@ -810,6 +813,7 @@ /** * Destroys the interaction manager + * */ InteractionManager.prototype.destroy = function () { this.removeEvents(); diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index 17b009b..14dc947 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -7,7 +7,7 @@ * @class * @extends PIXI.Container * @memberof PIXI.mesh - * @param texture {Texture} The texture to use + * @param texture {PIXI.Texture} The texture to use * @param [vertices] {Float32Arrif you want to specify the vertices * @param [uvs] {Float32Array} if you want to specify the uvs * @param [indices] {Uint16Array} if you want to specify the indices @@ -20,7 +20,7 @@ /** * The texture of the Mesh * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -59,10 +59,11 @@ this.dirty = true; /** - * The blend mode to be applied to the sprite. Set to blendModes.NORMAL to remove any blend mode. + * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove any blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = core.BLEND_MODES.NORMAL; @@ -74,9 +75,10 @@ this.canvasPadding = 0; /** - * The way the Mesh should be drawn, can be any of the Mesh.DRAW_MODES consts + * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts * * @member {number} + * @see PIXI.mesh.Mesh.DRAW_MODES */ this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH; @@ -129,7 +131,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @param renderer {PIXI.WebGLRenderer} a reference to the WebGL renderer * @private */ Mesh.prototype._renderWebGL = function (renderer) @@ -141,7 +143,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Mesh.prototype._renderCanvas = function (renderer) @@ -304,7 +306,7 @@ /** * Renders a flat Mesh * - * @param Mesh {Mesh} The Mesh to render + * @param Mesh {PIXI.mesh.Mesh} The Mesh to render * @private */ Mesh.prototype.renderMeshFlat = function (Mesh) @@ -334,21 +336,6 @@ context.closePath(); }; -/* - Mesh.prototype.setTexture = function (texture) - { - //TODO SET THE TEXTURES - //TODO VISIBILITY - //TODO SETTER - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; - }; - */ - /** * When the texture is updated, this event will fire to update the scale and frame * @@ -363,8 +350,8 @@ /** * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Mesh.prototype.getBounds = function (matrix) { @@ -419,7 +406,7 @@ /** * Tests if a point is inside this mesh. Works only for TRIANGLE_MESH * - * @param point {Point} the point to test + * @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Mesh.prototype.containsPoint = function( point ) { @@ -464,6 +451,7 @@ } return false; }; + /** * Different drawing buffer modes supported * diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/filters/twist/TwistFilter.js b/src/filters/twist/TwistFilter.js index acc1f82..4e95927 100644 --- a/src/filters/twist/TwistFilter.js +++ b/src/filters/twist/TwistFilter.js @@ -33,8 +33,8 @@ /** * This point describes the the offset of the twist. * - * @member {Point} - * @memberof TwistFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TwistFilter# */ offset: { get: function () @@ -51,7 +51,7 @@ * This radius of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ radius: { get: function () @@ -68,7 +68,7 @@ * This angle of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ angle: { get: function () diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index 6c3188c..9775971 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -11,14 +11,14 @@ /** * This point stores the global coords of where the touch/mouse event happened * - * @member {Point} + * @member {PIXI.Point} */ this.global = new core.Point(); /** * The target Sprite that was interacted with * - * @member {Sprite} + * @member {PIXI.Sprite} */ this.target = null; @@ -36,10 +36,10 @@ /** * This will return the local coordinates of the specified displayObject for this InteractionData * - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * param [globalPos] {Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject + * @param displayObject {PIXI.DisplayObject} The DisplayObject that you would like the local coords off + * @param [point] {PIXI.Point} A Point object in which to store the value, optional (otherwise will create a new point) + * param [globalPos] {PIXI.Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) + * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 15659fa..b7b607a 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -14,7 +14,7 @@ * * @class * @memberof PIXI.interaction - * @param renderer {CanvasRenderer|WebGLRenderer} A reference to the current renderer + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} A reference to the current renderer * @param [options] {object} * @param [options.autoPreventDefault=true] {boolean} Should the manager automatically prevent default browser actions. * @param [options.interactionFrequency=10] {number} Frequency increases the interaction events will be checked. @@ -26,7 +26,7 @@ /** * The renderer this interaction manager works for. * - * @member {SystemRenderer} + * @member {PIXI.SystemRenderer} */ this.renderer = renderer; @@ -49,14 +49,14 @@ /** * The mouse data * - * @member {InteractionData} + * @member {PIXI.interaction.InteractionData} */ this.mouse = new InteractionData(); /** * An event data object to handle all the event tracking/dispatching * - * @member {EventData} + * @member {object} */ this.eventData = { stopped: false, @@ -71,7 +71,7 @@ /** * Tiny little interactiveData pool ! * - * @member {Array} + * @member {PIXI.interaction.InteractionData[]} */ this.interactiveDataPool = []; @@ -150,7 +150,7 @@ /** * Internal cached var - * @member {Point} + * @member {PIXI.Point} * @private */ this._tempPoint = new core.Point(); @@ -189,6 +189,7 @@ /** * Registers all the DOM events + * * @private */ InteractionManager.prototype.addEvents = function () @@ -221,6 +222,7 @@ /** * Removes all the DOM events that were previously registered + * * @private */ InteractionManager.prototype.removeEvents = function () @@ -298,9 +300,10 @@ /** * Dispatches an event on the display object that was interacted with - * @param displayObject {Container|Sprite|TilingSprite} the display object in question + * + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} the display object in question * @param eventString {string} the name of the event (e.g, mousedown) - * @param eventData {EventData} the event data object + * @param eventData {object} the event data object * @private */ InteractionManager.prototype.dispatchEvent = function ( displayObject, eventString, eventData ) @@ -323,7 +326,7 @@ * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The resulting value is stored in the point. * This takes into account the fact that the DOM element could be scaled and positioned anywhere on the screen. * - * @param {Point} point the point that the result will be stored in + * @param {PIXI.Point} point the point that the result will be stored in * @param {number} x the x coord of the position to map * @param {number} y the y coord of the position to map */ @@ -338,9 +341,9 @@ * This function is provides a neat way of crawling through the scene graph and running a specified function on all interactive objects it finds. * It will also take care of hit testing the interactive objects and passes the hit across in the function. * - * @param {Point} point the point that is tested for collision - * @param {Container|Sprite|TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) - * @param {function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function + * @param {PIXI.Point} point the point that is tested for collision + * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) + * @param {Function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function * @param {boolean} hitTest this indicates if the objects inside should be hit test against the point * @return {boolean} returns true if the displayObject hit the point */ @@ -430,7 +433,7 @@ /** * Processes the result of the mouse down check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the dispay object * @private */ @@ -470,7 +473,7 @@ /** * Processes the result of the mouse up check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -534,7 +537,7 @@ /** * Processes the result of the mouse move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -573,7 +576,7 @@ /** * Processes the result of the mouse over/out check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -639,7 +642,7 @@ /** * Processes the result of a touch check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -656,8 +659,8 @@ /** * Is called when a touch ends on the renderer element - * @param event {Event} The DOM event of a touch ending on the renderer view * + * @param event {Event} The DOM event of a touch ending on the renderer view */ InteractionManager.prototype.onTouchEnd = function (event) { @@ -691,7 +694,7 @@ /** * Processes the result of the end of a touch and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -753,7 +756,7 @@ /** * Processes the result of a touch move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -799,7 +802,7 @@ /** * Returns an interaction data object to the internal pool * - * @param touchData {InteractionData} The touch data object we want to return to the pool + * @param touchData {PIXI.interaction.InteractionData} The touch data object we want to return to the pool * * @private */ @@ -810,6 +813,7 @@ /** * Destroys the interaction manager + * */ InteractionManager.prototype.destroy = function () { this.removeEvents(); diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index 17b009b..14dc947 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -7,7 +7,7 @@ * @class * @extends PIXI.Container * @memberof PIXI.mesh - * @param texture {Texture} The texture to use + * @param texture {PIXI.Texture} The texture to use * @param [vertices] {Float32Arrif you want to specify the vertices * @param [uvs] {Float32Array} if you want to specify the uvs * @param [indices] {Uint16Array} if you want to specify the indices @@ -20,7 +20,7 @@ /** * The texture of the Mesh * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -59,10 +59,11 @@ this.dirty = true; /** - * The blend mode to be applied to the sprite. Set to blendModes.NORMAL to remove any blend mode. + * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove any blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = core.BLEND_MODES.NORMAL; @@ -74,9 +75,10 @@ this.canvasPadding = 0; /** - * The way the Mesh should be drawn, can be any of the Mesh.DRAW_MODES consts + * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts * * @member {number} + * @see PIXI.mesh.Mesh.DRAW_MODES */ this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH; @@ -129,7 +131,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @param renderer {PIXI.WebGLRenderer} a reference to the WebGL renderer * @private */ Mesh.prototype._renderWebGL = function (renderer) @@ -141,7 +143,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Mesh.prototype._renderCanvas = function (renderer) @@ -304,7 +306,7 @@ /** * Renders a flat Mesh * - * @param Mesh {Mesh} The Mesh to render + * @param Mesh {PIXI.mesh.Mesh} The Mesh to render * @private */ Mesh.prototype.renderMeshFlat = function (Mesh) @@ -334,21 +336,6 @@ context.closePath(); }; -/* - Mesh.prototype.setTexture = function (texture) - { - //TODO SET THE TEXTURES - //TODO VISIBILITY - //TODO SETTER - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; - }; - */ - /** * When the texture is updated, this event will fire to update the scale and frame * @@ -363,8 +350,8 @@ /** * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Mesh.prototype.getBounds = function (matrix) { @@ -419,7 +406,7 @@ /** * Tests if a point is inside this mesh. Works only for TRIANGLE_MESH * - * @param point {Point} the point to test + * @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Mesh.prototype.containsPoint = function( point ) { @@ -464,6 +451,7 @@ } return false; }; + /** * Different drawing buffer modes supported * diff --git a/src/mesh/Rope.js b/src/mesh/Rope.js index 842ae4b..c3fc687 100644 --- a/src/mesh/Rope.js +++ b/src/mesh/Rope.js @@ -12,10 +12,10 @@ * ``` * * @class - * @extends PIXI.Mesh + * @extends PIXI.mesh.Mesh * @memberof PIXI.mesh - * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point} objects to construct this rope. + * @param {PIXI.Texture} texture - The texture to use on the rope. + * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope. * */ function Rope(texture, points) @@ -23,7 +23,7 @@ Mesh.call(this, texture); /* - * @member {Array} An array of points that determine the rope + * @member {PIXI.Point[]} An array of points that determine the rope */ this.points = points; diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/filters/twist/TwistFilter.js b/src/filters/twist/TwistFilter.js index acc1f82..4e95927 100644 --- a/src/filters/twist/TwistFilter.js +++ b/src/filters/twist/TwistFilter.js @@ -33,8 +33,8 @@ /** * This point describes the the offset of the twist. * - * @member {Point} - * @memberof TwistFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TwistFilter# */ offset: { get: function () @@ -51,7 +51,7 @@ * This radius of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ radius: { get: function () @@ -68,7 +68,7 @@ * This angle of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ angle: { get: function () diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index 6c3188c..9775971 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -11,14 +11,14 @@ /** * This point stores the global coords of where the touch/mouse event happened * - * @member {Point} + * @member {PIXI.Point} */ this.global = new core.Point(); /** * The target Sprite that was interacted with * - * @member {Sprite} + * @member {PIXI.Sprite} */ this.target = null; @@ -36,10 +36,10 @@ /** * This will return the local coordinates of the specified displayObject for this InteractionData * - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * param [globalPos] {Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject + * @param displayObject {PIXI.DisplayObject} The DisplayObject that you would like the local coords off + * @param [point] {PIXI.Point} A Point object in which to store the value, optional (otherwise will create a new point) + * param [globalPos] {PIXI.Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) + * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 15659fa..b7b607a 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -14,7 +14,7 @@ * * @class * @memberof PIXI.interaction - * @param renderer {CanvasRenderer|WebGLRenderer} A reference to the current renderer + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} A reference to the current renderer * @param [options] {object} * @param [options.autoPreventDefault=true] {boolean} Should the manager automatically prevent default browser actions. * @param [options.interactionFrequency=10] {number} Frequency increases the interaction events will be checked. @@ -26,7 +26,7 @@ /** * The renderer this interaction manager works for. * - * @member {SystemRenderer} + * @member {PIXI.SystemRenderer} */ this.renderer = renderer; @@ -49,14 +49,14 @@ /** * The mouse data * - * @member {InteractionData} + * @member {PIXI.interaction.InteractionData} */ this.mouse = new InteractionData(); /** * An event data object to handle all the event tracking/dispatching * - * @member {EventData} + * @member {object} */ this.eventData = { stopped: false, @@ -71,7 +71,7 @@ /** * Tiny little interactiveData pool ! * - * @member {Array} + * @member {PIXI.interaction.InteractionData[]} */ this.interactiveDataPool = []; @@ -150,7 +150,7 @@ /** * Internal cached var - * @member {Point} + * @member {PIXI.Point} * @private */ this._tempPoint = new core.Point(); @@ -189,6 +189,7 @@ /** * Registers all the DOM events + * * @private */ InteractionManager.prototype.addEvents = function () @@ -221,6 +222,7 @@ /** * Removes all the DOM events that were previously registered + * * @private */ InteractionManager.prototype.removeEvents = function () @@ -298,9 +300,10 @@ /** * Dispatches an event on the display object that was interacted with - * @param displayObject {Container|Sprite|TilingSprite} the display object in question + * + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} the display object in question * @param eventString {string} the name of the event (e.g, mousedown) - * @param eventData {EventData} the event data object + * @param eventData {object} the event data object * @private */ InteractionManager.prototype.dispatchEvent = function ( displayObject, eventString, eventData ) @@ -323,7 +326,7 @@ * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The resulting value is stored in the point. * This takes into account the fact that the DOM element could be scaled and positioned anywhere on the screen. * - * @param {Point} point the point that the result will be stored in + * @param {PIXI.Point} point the point that the result will be stored in * @param {number} x the x coord of the position to map * @param {number} y the y coord of the position to map */ @@ -338,9 +341,9 @@ * This function is provides a neat way of crawling through the scene graph and running a specified function on all interactive objects it finds. * It will also take care of hit testing the interactive objects and passes the hit across in the function. * - * @param {Point} point the point that is tested for collision - * @param {Container|Sprite|TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) - * @param {function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function + * @param {PIXI.Point} point the point that is tested for collision + * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) + * @param {Function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function * @param {boolean} hitTest this indicates if the objects inside should be hit test against the point * @return {boolean} returns true if the displayObject hit the point */ @@ -430,7 +433,7 @@ /** * Processes the result of the mouse down check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the dispay object * @private */ @@ -470,7 +473,7 @@ /** * Processes the result of the mouse up check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -534,7 +537,7 @@ /** * Processes the result of the mouse move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -573,7 +576,7 @@ /** * Processes the result of the mouse over/out check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -639,7 +642,7 @@ /** * Processes the result of a touch check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -656,8 +659,8 @@ /** * Is called when a touch ends on the renderer element - * @param event {Event} The DOM event of a touch ending on the renderer view * + * @param event {Event} The DOM event of a touch ending on the renderer view */ InteractionManager.prototype.onTouchEnd = function (event) { @@ -691,7 +694,7 @@ /** * Processes the result of the end of a touch and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -753,7 +756,7 @@ /** * Processes the result of a touch move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -799,7 +802,7 @@ /** * Returns an interaction data object to the internal pool * - * @param touchData {InteractionData} The touch data object we want to return to the pool + * @param touchData {PIXI.interaction.InteractionData} The touch data object we want to return to the pool * * @private */ @@ -810,6 +813,7 @@ /** * Destroys the interaction manager + * */ InteractionManager.prototype.destroy = function () { this.removeEvents(); diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index 17b009b..14dc947 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -7,7 +7,7 @@ * @class * @extends PIXI.Container * @memberof PIXI.mesh - * @param texture {Texture} The texture to use + * @param texture {PIXI.Texture} The texture to use * @param [vertices] {Float32Arrif you want to specify the vertices * @param [uvs] {Float32Array} if you want to specify the uvs * @param [indices] {Uint16Array} if you want to specify the indices @@ -20,7 +20,7 @@ /** * The texture of the Mesh * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -59,10 +59,11 @@ this.dirty = true; /** - * The blend mode to be applied to the sprite. Set to blendModes.NORMAL to remove any blend mode. + * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove any blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = core.BLEND_MODES.NORMAL; @@ -74,9 +75,10 @@ this.canvasPadding = 0; /** - * The way the Mesh should be drawn, can be any of the Mesh.DRAW_MODES consts + * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts * * @member {number} + * @see PIXI.mesh.Mesh.DRAW_MODES */ this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH; @@ -129,7 +131,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @param renderer {PIXI.WebGLRenderer} a reference to the WebGL renderer * @private */ Mesh.prototype._renderWebGL = function (renderer) @@ -141,7 +143,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Mesh.prototype._renderCanvas = function (renderer) @@ -304,7 +306,7 @@ /** * Renders a flat Mesh * - * @param Mesh {Mesh} The Mesh to render + * @param Mesh {PIXI.mesh.Mesh} The Mesh to render * @private */ Mesh.prototype.renderMeshFlat = function (Mesh) @@ -334,21 +336,6 @@ context.closePath(); }; -/* - Mesh.prototype.setTexture = function (texture) - { - //TODO SET THE TEXTURES - //TODO VISIBILITY - //TODO SETTER - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; - }; - */ - /** * When the texture is updated, this event will fire to update the scale and frame * @@ -363,8 +350,8 @@ /** * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Mesh.prototype.getBounds = function (matrix) { @@ -419,7 +406,7 @@ /** * Tests if a point is inside this mesh. Works only for TRIANGLE_MESH * - * @param point {Point} the point to test + * @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Mesh.prototype.containsPoint = function( point ) { @@ -464,6 +451,7 @@ } return false; }; + /** * Different drawing buffer modes supported * diff --git a/src/mesh/Rope.js b/src/mesh/Rope.js index 842ae4b..c3fc687 100644 --- a/src/mesh/Rope.js +++ b/src/mesh/Rope.js @@ -12,10 +12,10 @@ * ``` * * @class - * @extends PIXI.Mesh + * @extends PIXI.mesh.Mesh * @memberof PIXI.mesh - * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point} objects to construct this rope. + * @param {PIXI.Texture} texture - The texture to use on the rope. + * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope. * */ function Rope(texture, points) @@ -23,7 +23,7 @@ Mesh.call(this, texture); /* - * @member {Array} An array of points that determine the rope + * @member {PIXI.Point[]} An array of points that determine the rope */ this.points = points; diff --git a/src/mesh/webgl/MeshRenderer.js b/src/mesh/webgl/MeshRenderer.js index a5a8e44..0be74df 100644 --- a/src/mesh/webgl/MeshRenderer.js +++ b/src/mesh/webgl/MeshRenderer.js @@ -18,7 +18,7 @@ * @private * @memberof PIXI.mesh * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function MeshRenderer(renderer) { @@ -64,7 +64,7 @@ /** * Renders the sprite object. * - * @param mesh {Mesh} the mesh to render + * @param mesh {PIXI.mesh.Mesh} the mesh to render */ MeshRenderer.prototype.render = function (mesh) { @@ -153,7 +153,7 @@ /** * Prepares all the buffers to render this mesh - * @param mesh {Mesh} the mesh to render + * @param mesh {PIXI.mesh.Mesh} the mesh to render */ MeshRenderer.prototype._initWebGL = function (mesh) { diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 039e124..272da0c 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -22,7 +22,7 @@ /** * The array of children of this container. * - * @member {DisplayObject[]} + * @member {PIXI.DisplayObject[]} * @readonly */ this.children = []; @@ -104,8 +104,8 @@ /** * Adds a child to the container. * - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The DisplayObject to add to the container + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChild = function (child) { @@ -115,9 +115,9 @@ /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. + * @param child {PIXI.DisplayObject} The child to add + * @param index {number} The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ Container.prototype.addChildAt = function (child, index) { @@ -152,8 +152,8 @@ /** * Swaps the position of 2 Display Objects within this container. * - * @param child {DisplayObject} - * @param child2 {DisplayObject} + * @param child {PIXI.DisplayObject} + * @param child2 {PIXI.DisplayObject} */ Container.prototype.swapChildren = function (child, child2) { @@ -178,8 +178,8 @@ /** * Returns the index position of a child DisplayObject instance * - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify + * @param child {PIXI.DisplayObject} The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ Container.prototype.getChildIndex = function (child) { @@ -196,8 +196,8 @@ /** * Changes the position of an existing child in the display object container * - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object + * @param child {PIXI.DisplayObject} The child DisplayObject instance for which you want to change the index number + * @param index {number} The resulting index number for the child display object */ Container.prototype.setChildIndex = function (child, index) { @@ -216,8 +216,8 @@ /** * Returns the child at the specified index * - * @param index {Number} The index to get the child at - * @return {DisplayObject} The child at the given index, if any. + * @param index {number} The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ Container.prototype.getChildAt = function (index) { @@ -232,8 +232,8 @@ /** * Removes a child from the container. * - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. + * @param child {PIXI.DisplayObject} The DisplayObject to remove + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChild = function (child) { @@ -250,8 +250,8 @@ /** * Removes a child from the specified index position. * - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. + * @param index {number} The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ Container.prototype.removeChildAt = function (index) { @@ -269,8 +269,8 @@ /** * Removes all children from this container that are within the begin and end indexes. * - * @param beginIndex {Number} The beginning position. Default value is 0. - * @param endIndex {Number} The ending position. Default value is size of the container. + * @param beginIndex {number} The beginning position. Default value is 0. + * @param endIndex {number} The ending position. Default value is size of the container. */ Container.prototype.removeChildren = function (beginIndex, endIndex) { @@ -310,10 +310,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param resolution {number} The resolution of the texture being generated + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} a texture of the display object */ Container.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -355,7 +355,7 @@ /** * Retrieves the bounds of the Container as a rectangle. The bounds calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getBounds = function () { @@ -428,7 +428,7 @@ * Retrieves the non-global local bounds of the Container as a rectangle. * The calculation takes all visible children into consideration. * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ Container.prototype.getLocalBounds = function () { @@ -451,7 +451,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer */ Container.prototype.renderWebGL = function (renderer) { @@ -520,7 +520,7 @@ /** * To be overridden by the subclass * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ Container.prototype._renderWebGL = function (renderer) // jshint unused:false @@ -531,7 +531,7 @@ /** * To be overridden by the subclass * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Container.prototype._renderCanvas = function (renderer) // jshint unused:false @@ -543,7 +543,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer */ Container.prototype.renderCanvas = function (renderer) { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 00a4ba2..722c34a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -19,21 +19,21 @@ /** * The coordinate of the object relative to the local coordinates of the parent. * - * @member {Point} + * @member {PIXI.Point} */ this.position = new math.Point(); /** * The scale factor of the object. * - * @member {Point} + * @member {PIXI.Point} */ this.scale = new math.Point(1, 1); /** * The pivot point of the displayObject that it rotates around * - * @member {Point} + * @member {PIXI.Point} */ this.pivot = new math.Point(0, 0); @@ -70,7 +70,7 @@ /** * The display object container that contains this display object. * - * @member {Container} + * @member {PIXI.Container} * @readOnly */ this.parent = null; @@ -86,7 +86,7 @@ /** * Current transform of the object based on world (parent) factors * - * @member {Matrix} + * @member {PIXI.Matrix} * @readOnly */ this.worldTransform = new math.Matrix(); @@ -95,7 +95,7 @@ * The area the filter is applied to. This is used as more of an optimisation * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.filterArea = null; @@ -118,7 +118,7 @@ /** * The original, cached bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._bounds = new math.Rectangle(0, 0, 1, 1); @@ -126,7 +126,7 @@ /** * The most up-to-date bounds of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._currentBounds = null; @@ -134,22 +134,10 @@ /** * The original, cached mask of the object * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._mask = null; - - //TODO rename to _isMask - // this.isMask = false; - - /** - * Cached internal flag. - * - * @member {boolean} - * @private - */ - this._cacheAsBitmap = false; - this._cachedObject = null; } // constructor @@ -162,7 +150,7 @@ * The position of the displayObject on the x axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ x: { get: function () @@ -179,7 +167,7 @@ * The position of the displayObject on the y axis relative to the local coordinates of the parent. * * @member {number} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ y: { get: function () @@ -222,7 +210,7 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * - * @member {Graphics | Sprite} + * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ mask: { @@ -251,7 +239,7 @@ * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to 'null' * - * @member {Filter[]} + * @member {PIXI.AbstractFilter[]} * @memberof PIXI.DisplayObject# */ filters: { @@ -348,8 +336,8 @@ * * Retrieves the bounds of the displayObject as a rectangle object * - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area + * @param matrix {PIXI.Matrix} + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getBounds = function (matrix) // jshint unused:false { @@ -359,7 +347,7 @@ /** * Retrieves the local bounds of the displayObject as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @return {PIXI.Rectangle} the rectangular bounding area */ DisplayObject.prototype.getLocalBounds = function () { @@ -369,8 +357,8 @@ /** * Calculates the global position of the display object * - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toGlobal = function (position) { @@ -382,9 +370,9 @@ /** * Calculates the local position of the display object relative to another point * - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object + * @param position {PIXI.Point} The world origin to calculate from + * @param [from] {PIXI.DisplayObject} The DisplayObject to calculate the global position from + * @return {PIXI.Point} A point object representing the position of this object */ DisplayObject.prototype.toLocal = function (position, from) { @@ -401,7 +389,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} The renderer + * @param renderer {PIXI.WebGLRenderer} The renderer * @private */ DisplayObject.prototype.renderWebGL = function (renderer) // jshint unused:false @@ -412,7 +400,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The renderer + * @param renderer {PIXI.CanvasRenderer} The renderer * @private */ DisplayObject.prototype.renderCanvas = function (renderer) // jshint unused:false @@ -423,10 +411,10 @@ * Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. * - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @param scaleMode {Number} See {@link SCALE_MODES} for possible values - * @param resolution {Number} The resolution of the texture being generated - * @return {Texture} a texture of the display object + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used to generate the texture. + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @param resolution {number} The resolution of the texture being generated + * @return {PIXI.Texture} a texture of the display object */ DisplayObject.prototype.generateTexture = function (renderer, scaleMode, resolution) { diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 0073fbf..91225e0 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -46,7 +46,7 @@ /** * Graphics data * - * @member {GraphicsData[]} + * @member {PIXI.GraphicsData[]} * @private */ this.graphicsData = []; @@ -69,17 +69,18 @@ this._prevTint = 0xFFFFFF; /** - * The blend mode to be applied to the graphic shape. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the graphic shape. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * Current path * - * @member {GraphicsData} + * @member {PIXI.GraphicsData} * @private */ this.currentPath = null; @@ -110,7 +111,7 @@ /** * A cache of the local bounds to prevent recalculation. * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._localBounds = new math.Rectangle(0,0,1,1); @@ -142,14 +143,7 @@ * @private */ this.cachedSpriteDirty = false; -} -// constructor -Graphics.prototype = Object.create(Container.prototype); -Graphics.prototype.constructor = Graphics; -module.exports = Graphics; - -Object.defineProperties(Graphics.prototype, { /** * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. * This is useful if your graphics element does not change often, as it will speed up the rendering @@ -157,19 +151,23 @@ * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if * you are constantly redrawing the graphics element. * + * @name cacheAsBitmap * @member {boolean} - * @memberof Graphics# + * @memberof PIXI.Graphics# * @default false - * @private */ +} -}); +// constructor +Graphics.prototype = Object.create(Container.prototype); +Graphics.prototype.constructor = Graphics; +module.exports = Graphics; /** * 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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clone = function () { @@ -206,7 +204,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineStyle = function (lineWidth, color, alpha) { @@ -238,7 +236,7 @@ * * @param x {number} the X coordinate to move to * @param y {number} the Y coordinate to move to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.moveTo = function (x, y) { @@ -253,7 +251,7 @@ * * @param x {number} the X coordinate to draw to * @param y {number} the Y coordinate to draw to - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.lineTo = function (x, y) { @@ -271,7 +269,7 @@ * @param cpY {number} Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) { @@ -326,7 +324,7 @@ * @param cpY2 {number} Second Control point y * @param toX {number} Destination point x * @param toY {number} Destination point y - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) { @@ -385,7 +383,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) { @@ -452,7 +450,7 @@ * @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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) { @@ -544,7 +542,7 @@ * * @param color {number} the color of the fill * @param alpha {number} the alpha of the fill - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.beginFill = function (color, alpha) { @@ -584,7 +582,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawRect = function ( x, y, width, height ) { @@ -600,6 +598,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} */ Graphics.prototype.drawRoundedRect = function ( x, y, width, height, radius ) { @@ -614,7 +613,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawCircle = function (x, y, radius) { @@ -630,7 +629,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 {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.drawEllipse = function (x, y, width, height) { @@ -642,8 +641,8 @@ /** * Draws a polygon using the given path. * - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} + * @param path {number[]|PIXI.Point[]} The path data used to construct the polygon. + * @return {PIXI.Graphics} */ Graphics.prototype.drawPolygon = function (path) { @@ -671,7 +670,7 @@ /** * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. * - * @return {Graphics} + * @return {PIXI.Graphics} */ Graphics.prototype.clear = function () { @@ -691,7 +690,7 @@ * * @param resolution {number} The resolution of the texture being generated * @param scaleMode {number} Should be one of the scaleMode consts - * @return {Texture} a texture of the graphics object + * @return {PIXI.Texture} a texture of the graphics object */ Graphics.prototype.generateTexture = function (renderer, resolution, scaleMode) { @@ -717,7 +716,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ Graphics.prototype._renderWebGL = function (renderer) @@ -763,7 +762,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Graphics.prototype._renderCanvas = function (renderer) @@ -827,7 +826,9 @@ /** * Retrieves the bounds of the graphic shape as a rectangle object * - * @return {Rectangle} the rectangular bounding area + * @param [matrix] {PIXI.Matrix} The world transform matrix to use, defaults to this + * object's worldTransform. + * @return {PIXI.Rectangle} the rectangular bounding area */ Graphics.prototype.getBounds = function (matrix) { @@ -915,7 +916,7 @@ /** * Tests if a point is inside this graphics object * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Graphics.prototype.containsPoint = function( point ) @@ -1126,8 +1127,8 @@ /** * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. * - * @param shape {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. + * @param shape {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. */ Graphics.prototype.drawShape = function (shape) { @@ -1157,6 +1158,9 @@ return data; }; +/** + * Destroys the Graphics object. + */ Graphics.prototype.destroy = function () { Container.prototype.destroy.apply(this, arguments); diff --git a/src/core/graphics/GraphicsData.js b/src/core/graphics/GraphicsData.js index 0e79fbb..1d33508 100644 --- a/src/core/graphics/GraphicsData.js +++ b/src/core/graphics/GraphicsData.js @@ -52,7 +52,7 @@ this.fill = fill; /* - * @member {Circle|Rectangle|Ellipse|Line|Polygon} The shape object to draw. + * @member {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Line|PIXI.Polygon} The shape object to draw. */ this.shape = shape; @@ -68,7 +68,7 @@ /** * Creates a new GraphicsData object with the same values as this one. * - * @return {GraphicsData} + * @return {PIXI.GraphicsData} */ GraphicsData.prototype.clone = function () { @@ -83,6 +83,9 @@ ); }; +/** + * Destroys the Graphics data. + */ GraphicsData.prototype.destroy = function () { this.shape = null; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index cabe607..03bb890 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -13,7 +13,7 @@ * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function GraphicsRenderer(renderer) { @@ -65,7 +65,7 @@ /** * Renders a graphics object. * - * @param graphics {Graphics} The graphics object to render. + * @param graphics {PIXI.Graphics} The graphics object to render. */ GraphicsRenderer.prototype.render = function(graphics) { @@ -140,7 +140,7 @@ * Updates the graphics object * * @private - * @param graphicsData {Graphics} The graphics object to update + * @param graphicsData {PIXI.Graphics} The graphics object to update */ GraphicsRenderer.prototype.updateGraphics = function(graphics) { @@ -303,7 +303,7 @@ * Builds a rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRectangle = function (graphicsData, webGLData) @@ -369,7 +369,7 @@ * Builds a rounded rectangle to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildRoundedRectangle = function (graphicsData, webGLData) @@ -491,7 +491,7 @@ * Builds a circle to draw * * @private - * @param graphicsData {Graphics} The graphics object to draw + * @param graphicsData {PIXI.Graphics} The graphics object to draw * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildCircle = function (graphicsData, webGLData) @@ -572,7 +572,7 @@ * Builds a line to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildLine = function (graphicsData, webGLData) @@ -787,7 +787,7 @@ * Builds a complex polygon to draw * * @private - * @param graphicsData {Graphics} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.Graphics} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildComplexPoly = function (graphicsData, webGLData) @@ -849,7 +849,7 @@ * Builds a polygon to draw * * @private - * @param graphicsData {WebGLGraphicsData} The graphics object containing all the necessary properties + * @param graphicsData {PIXI.WebGLGraphicsData} The graphics object containing all the necessary properties * @param webGLData {object} an object containing all the webGL-specific information to create this shape */ GraphicsRenderer.prototype.buildPoly = function (graphicsData, webGLData) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index b422b8e..ff4e7f0 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -18,19 +18,19 @@ //TODO does this need to be split before uploding?? /** * An array of color components (r,g,b) - * @member {Array} + * @member {number[]} */ this.color = [0,0,0]; // color split! /** * An array of points to draw - * @member {Array} + * @member {PIXI.Point[]} */ this.points = []; /** * The indices of the vertices - * @member {Array} + * @member {number[]} */ this.indices = []; /** diff --git a/src/core/math/Matrix.js b/src/core/math/Matrix.js index 12e0a82..7aead33 100644 --- a/src/core/math/Matrix.js +++ b/src/core/math/Matrix.js @@ -121,9 +121,9 @@ * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix */ Matrix.prototype.apply = function (pos, newPos) { @@ -142,9 +142,9 @@ * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix + * @param pos {PIXI.Point} The origin + * @param [newPos] {PIXI.Point} The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix */ Matrix.prototype.applyInverse = function (pos, newPos) { @@ -166,7 +166,7 @@ * * @param {number} x * @param {number} y - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.translate = function (x, y) { @@ -181,7 +181,7 @@ * * @param {number} x The amount to scale horizontally * @param {number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.scale = function (x, y) { @@ -200,7 +200,7 @@ * Applies a rotation transformation to the matrix. * * @param {number} angle - The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.rotate = function (angle) { @@ -224,8 +224,8 @@ /** * Appends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.append = function (matrix) { @@ -248,8 +248,8 @@ /** * Prepends the given Matrix to this Matrix. * - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. + * @param {PIXI.Matrix} matrix + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.prepend = function(matrix) { @@ -274,7 +274,7 @@ /** * Inverts this matrix * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.invert = function() { @@ -299,7 +299,7 @@ /** * Resets this Matix to an identity (default) matrix. * - * @return {Matrix} This matrix. Good for chaining method calls. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. */ Matrix.prototype.identity = function () { @@ -316,7 +316,7 @@ /** * Creates a new Matrix object with the same values as this one. * - * @return {Matrix} A copy of this matrix. Good for chaining method calls. + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. */ Matrix.prototype.clone = function () { @@ -334,7 +334,7 @@ /** * Changes the values of the given matrix to be the same as the ones in this matrix * - * @return {Matrix} The matrix given in parameter with its values updated. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. */ Matrix.prototype.copy = function (matrix) { @@ -350,9 +350,16 @@ /** * A default (identity) matrix + * + * @static + * @const */ Matrix.IDENTITY = new Matrix(); + /** * A temp matrix + * + * @static + * @const */ Matrix.TEMP_MATRIX = new Matrix(); diff --git a/src/core/math/Point.js b/src/core/math/Point.js index 7634ae8..8202a6f 100644 --- a/src/core/math/Point.js +++ b/src/core/math/Point.js @@ -28,7 +28,7 @@ /** * Creates a clone of this point * - * @return {Point} a copy of the point + * @return {PIXI.Point} a copy of the point */ Point.prototype.clone = function () { @@ -38,7 +38,7 @@ /** * Copies x and y from the given point * - * @param p {Point} + * @param p {PIXI.Point} */ Point.prototype.copy = function (p) { this.set(p.x, p.y); @@ -47,7 +47,7 @@ /** * Returns true if the given point is equal to this point * - * @param p {Point} + * @param p {PIXI.Point} * @returns {boolean} */ Point.prototype.equals = function (p) { diff --git a/src/core/math/shapes/Circle.js b/src/core/math/shapes/Circle.js index d505c87..a4794a4 100644 --- a/src/core/math/shapes/Circle.js +++ b/src/core/math/shapes/Circle.js @@ -44,7 +44,7 @@ /** * Creates a clone of this Circle instance * - * @return {Circle} a copy of the Circle + * @return {PIXI.Circle} a copy of the Circle */ Circle.prototype.clone = function () { @@ -78,7 +78,7 @@ /** * Returns the framing rectangle of the circle as a Rectangle object * -* @return {Rectangle} the framing rectangle +* @return {PIXI.Rectangle} the framing rectangle */ Circle.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Ellipse.js b/src/core/math/shapes/Ellipse.js index c694eb0..d1d1d79 100644 --- a/src/core/math/shapes/Ellipse.js +++ b/src/core/math/shapes/Ellipse.js @@ -51,7 +51,7 @@ /** * Creates a clone of this Ellipse instance * - * @return {Ellipse} a copy of the ellipse + * @return {PIXI.Ellipse} a copy of the ellipse */ Ellipse.prototype.clone = function () { @@ -85,7 +85,7 @@ /** * Returns the framing rectangle of the ellipse as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ Ellipse.prototype.getBounds = function () { diff --git a/src/core/math/shapes/Polygon.js b/src/core/math/shapes/Polygon.js index 29797b8..3119ac9 100644 --- a/src/core/math/shapes/Polygon.js +++ b/src/core/math/shapes/Polygon.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param points {Point[]|number[]|...Point|...number} This can be an array of Points that form the polygon, + * @param points {PIXI.Point[]|number[]|...PIXI.Point|...number} This can be an array of Points that form the polygon, * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are @@ -63,7 +63,7 @@ /** * Creates a clone of this polygon * - * @return {Polygon} a copy of the polygon + * @return {PIXI.Polygon} a copy of the polygon */ Polygon.prototype.clone = function () { diff --git a/src/core/math/shapes/Rectangle.js b/src/core/math/shapes/Rectangle.js index 8fdb579..40d434c 100644 --- a/src/core/math/shapes/Rectangle.js +++ b/src/core/math/shapes/Rectangle.js @@ -59,7 +59,7 @@ /** * Creates a clone of this Rectangle * - * @return {Rectangle} a copy of the rectangle + * @return {PIXI.Rectangle} a copy of the rectangle */ Rectangle.prototype.clone = function () { diff --git a/src/core/math/shapes/RoundedRectangle.js b/src/core/math/shapes/RoundedRectangle.js index 9d8fa97..781bb2b 100644 --- a/src/core/math/shapes/RoundedRectangle.js +++ b/src/core/math/shapes/RoundedRectangle.js @@ -57,7 +57,7 @@ /** * Creates a clone of this Rounded Rectangle * - * @return {RoundedRectangle} a copy of the rounded rectangle + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle */ RoundedRectangle.prototype.clone = function () { diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 784bc25..c197ca7 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -24,7 +24,6 @@ * @class * @extends PIXI.Container * @memberof PIXI - * * @param [maxSize=15000] {number} The maximum number of particles that can be renderer by the container. * @param [properties] {object} The properties of children that should be uploaded to the gpu and applied. * @param [properties.scale=false] {boolean} When true, scale be uploaded and applied. @@ -56,7 +55,7 @@ /** * Set properties to be dynamic (true) / static (false) * - * @member {array} + * @member {boolean[]} * @private */ this._properties = [false, true, false, false, false]; @@ -92,10 +91,11 @@ this.interactiveChildren = false; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; @@ -146,7 +146,7 @@ /** * Renders the container using the WebGL renderer * - * @param renderer {WebGLRenderer} The webgl renderer + * @param renderer {PIXI.WebGLRenderer} The webgl renderer * @private */ ParticleContainer.prototype.renderWebGL = function (renderer) @@ -173,7 +173,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} The canvas renderer + * @param renderer {PIXI.CanvasRenderer} The canvas renderer * @private */ ParticleContainer.prototype.renderCanvas = function (renderer) diff --git a/src/core/particles/webgl/ParticleBuffer.js b/src/core/particles/webgl/ParticleBuffer.js index f319f18..316cd4f 100644 --- a/src/core/particles/webgl/ParticleBuffer.js +++ b/src/core/particles/webgl/ParticleBuffer.js @@ -11,29 +11,30 @@ */ /** + * The particle buffer manages the static and dynamic buffers for a particle container. * * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. */ function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) { /** - * the current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; /** - * + * Size of a single vertex. * * @member {number} */ this.vertSize = 2; /** - * + * Size of a single vertex in bytes. * * @member {number} */ @@ -47,16 +48,16 @@ this.size = size; /** + * A list of the properties that are dynamic. * - * - * @member {Array} + * @member {object[]} */ this.dynamicProperties = []; /** + * A list of the properties that are static. * - * - * @member {Array} + * @member {object[]} */ this.staticProperties = []; @@ -93,7 +94,6 @@ * Sets up the renderer context and necessary buffers. * * @private - * @param gl {WebGLRenderingContext} the current WebGL drawing context */ ParticleBuffer.prototype.initBuffers = function () { @@ -138,9 +138,12 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.staticBuffer); gl.bufferData(gl.ARRAY_BUFFER, this.staticData, gl.DYNAMIC_DRAW); - }; +/** + * Uploads the dynamic properties. + * + */ ParticleBuffer.prototype.uploadDynamic = function(children, startIndex, amount) { var gl = this.gl; @@ -155,6 +158,10 @@ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.dynamicData); }; +/** + * Uploads the static properties. + * + */ ParticleBuffer.prototype.uploadStatic = function(children, startIndex, amount) { var gl = this.gl; @@ -170,7 +177,7 @@ }; /** - * Starts a new sprite batch. + * Binds the buffers to the GPU * */ ParticleBuffer.prototype.bind = function () @@ -196,7 +203,7 @@ }; /** - * Destroys the SpriteBatch. + * Destroys the ParticleBuffer. * */ ParticleBuffer.prototype.destroy = function () diff --git a/src/core/particles/webgl/ParticleRenderer.js b/src/core/particles/webgl/ParticleRenderer.js index eefbdda..d4d480a 100644 --- a/src/core/particles/webgl/ParticleRenderer.js +++ b/src/core/particles/webgl/ParticleRenderer.js @@ -20,7 +20,7 @@ * @class * @private * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function ParticleRenderer(renderer) { @@ -52,7 +52,7 @@ /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; @@ -73,7 +73,6 @@ * When there is a WebGL context change * * @private - * */ ParticleRenderer.prototype.onContextChange = function () { @@ -130,7 +129,7 @@ }; /** - * Starts a new sprite batch. + * Starts a new particle batch. * */ ParticleRenderer.prototype.start = function () @@ -151,11 +150,11 @@ /** - * Renders the sprite object. + * Renders the particle container object. * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.render = function ( container ) +ParticleRenderer.prototype.render = function (container) { var children = container.children, totalChildren = children.length, @@ -176,8 +175,6 @@ container._buffers = this.generateBuffers( container ); } - - // if the uvs have not updated then no point rendering just yet! this.renderer.blendModeManager.setBlendMode(container.blendMode); @@ -247,9 +244,9 @@ /** * Creates one particle buffer for each child in the container we want to render and updates internal properties * - * @param container {Container|Sprite} the sprite to render using this ParticleRenderer + * @param container {PIXI.ParticleContainer} The container to render using this ParticleRenderer */ -ParticleRenderer.prototype.generateBuffers = function ( container ) +ParticleRenderer.prototype.generateBuffers = function (container) { var gl = this.renderer.gl, buffers = [], @@ -266,13 +263,13 @@ return buffers; }; - /** + * Uploads the verticies. * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their vertices uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -331,10 +328,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their positions uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -363,10 +360,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their rotation uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -388,10 +385,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their Uvs uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -439,10 +436,10 @@ /** * - * @param children {Array} the array of display objects to render + * @param children {PIXI.DisplayObject[]} the array of display objects to render * @param startIndex {number} the index to start from in the children array * @param amount {number} the amount of children that will have their alpha uploaded - * @param array {Array} + * @param array {number[]} * @param stride {number} * @param offset {number} */ @@ -463,7 +460,7 @@ /** - * Destroys the Particle. + * Destroys the ParticleRenderer. * */ ParticleRenderer.prototype.destroy = function () diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index dc4509f..10402d7 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -20,6 +20,7 @@ * @param [options.resolution=1] {number} the resolution of the renderer retina would be 2 * @param [options.clearBeforeRender=true] {boolean} This sets if the CanvasRenderer will clear the canvas or * not before the new render pass. + * @param [options.backgroundColor=0x000000] {number} The background color of the rendered area (shown if not transparent). */ function SystemRenderer(system, width, height, options) { @@ -46,8 +47,9 @@ /** * The type of the renderer. * - * @member {RENDERER_TYPE} - * @default CONT.RENDERER_TYPE.UNKNOWN + * @member {number} + * @default PIXI.RENDERER_TYPE.UNKNOWN + * @see PIXI.RENDERER_TYPE */ this.type = CONST.RENDERER_TYPE.UNKNOWN; @@ -149,12 +151,18 @@ /** * This temporary display object used as the parent of the currently being rendered item - * @member {DisplayObject} + * + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = {worldTransform:new math.Matrix(), worldAlpha:1, children:[]}; - // + /** + * The last root object that the renderer tried to render. + * + * @member {PIXI.DisplayObject} + * @private + */ this._lastObjectRendered = this._tempDisplayObjectParent; } @@ -168,7 +176,7 @@ * The background color to fill if not transparent * * @member {number} - * @memberof SystemRenderer# + * @memberof PIXI.SystemRenderer# */ backgroundColor: { diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 61ddc7d..1ed0c28 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -48,7 +48,7 @@ /** * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. * - * @member {CanvasMaskManager} + * @member {PIXI.CanvasMaskManager} */ this.maskManager = new CanvasMaskManager(); @@ -63,14 +63,18 @@ /** * Tracks the active scale mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.currentScaleMode = CONST.SCALE_MODES.DEFAULT; /** * Tracks the active blend mode for this renderer. * - * @member {SCALE_MODE} + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.currentBlendMode = CONST.BLEND_MODES.NORMAL; @@ -108,7 +112,7 @@ /** * This temporary display object used as the parent of the currently being rendered item * - * @member {DisplayObject} + * @member {PIXI.DisplayObject} * @private */ this._tempDisplayObjectParent = { @@ -129,7 +133,7 @@ /** * Renders the object to this canvas view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ CanvasRenderer.prototype.render = function (object) { @@ -203,7 +207,7 @@ /** * Renders a display object * - * @param displayObject {DisplayObject} The displayObject to render + * @param displayObject {PIXI.DisplayObject} The displayObject to render * @private */ CanvasRenderer.prototype.renderDisplayObject = function (displayObject, context) diff --git a/src/core/renderers/canvas/utils/CanvasBuffer.js b/src/core/renderers/canvas/utils/CanvasBuffer.js index 2cb6dc9..bb9b4fe 100644 --- a/src/core/renderers/canvas/utils/CanvasBuffer.js +++ b/src/core/renderers/canvas/utils/CanvasBuffer.js @@ -34,7 +34,7 @@ * The width of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ width: { get: function () @@ -50,7 +50,7 @@ * The height of the canvas buffer in pixels. * * @member {number} - * @memberof CanvasBuffer# + * @memberof PIXI.CanvasBuffer# */ height: { get: function () diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 53aecbc..ad66340 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -12,7 +12,7 @@ /* * Renders a Graphics object to a canvas. * - * @param graphics {Graphics} the actual graphics object to render + * @param graphics {PIXI.Graphics} the actual graphics object to render * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas */ CanvasGraphics.renderGraphics = function (graphics, context) @@ -194,7 +194,7 @@ * Renders a graphics mask * * @private - * @param graphics {Graphics} the graphics which will be used as a mask + * @param graphics {PIXI.Graphics} the graphics which will be used as a mask * @param context {CanvasRenderingContext2D} the context 2d method of the canvas */ CanvasGraphics.renderGraphicsMask = function (graphics, context) @@ -299,8 +299,8 @@ * Updates the tint of a graphics object * * @private - * @param graphics {Graphics} the graphics that will have its tint updated - * + * @param graphics {PIXI.Graphics} the graphics that will have its tint updated + * */ CanvasGraphics.updateGraphicsTint = function (graphics) { diff --git a/src/core/renderers/canvas/utils/CanvasMaskManager.js b/src/core/renderers/canvas/utils/CanvasMaskManager.js index 9c76c90..48e5397 100644 --- a/src/core/renderers/canvas/utils/CanvasMaskManager.js +++ b/src/core/renderers/canvas/utils/CanvasMaskManager.js @@ -16,7 +16,7 @@ * This method adds it to the current stack of masks. * * @param maskData {object} the maskData that will be pushed - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.pushMask = function (maskData, renderer) { @@ -50,7 +50,7 @@ /** * Restores the current drawing context to the state it was before the mask was applied. * - * @param renderer {WebGLRenderer|CanvasRenderer} The renderer context to use. + * @param renderer {PIXI.WebGLRenderer|PIXI.CanvasRenderer} The renderer context to use. */ CanvasMaskManager.prototype.popMask = function (renderer) { diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index 5d83924..c4447e8 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -12,7 +12,7 @@ /** * Basically this method just needs a sprite and a color and tints the sprite with the given color. * - * @param sprite {Sprite} the sprite to tint + * @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 */ @@ -58,7 +58,7 @@ /** * Tint a texture using the 'multiply' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -107,7 +107,7 @@ /** * Tint a texture using the 'overlay' operation. * - * @param texture {Texture} the texture to tint + * @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 */ @@ -143,7 +143,7 @@ /** * Tint a texture pixel per pixel. * - * @param texture {Texture} the texture to tint + * @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 */ diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 33439a6..5edba93 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -65,7 +65,7 @@ /** * The fxaa filter * - * @member {FXAAFilter} + * @member {PIXI.FXAAFilter} * @private */ this._FXAAFilter = null; @@ -94,47 +94,50 @@ /** * Deals with managing the shader programs and their attribs. * - * @member {ShaderManager} + * @member {PIXI.ShaderManager} */ this.shaderManager = new ShaderManager(this); /** * Manages the masks using the stencil buffer. * - * @member {MaskManager} + * @member {PIXI.MaskManager} */ this.maskManager = new MaskManager(this); /** * Manages the stencil buffer. * - * @member {StencilManager} + * @member {PIXI.StencilManager} */ this.stencilManager = new StencilManager(this); /** * Manages the filters. * - * @member {FilterManager} + * @member {PIXI.FilterManager} */ this.filterManager = new FilterManager(this); /** * Manages the blendModes - * @member {BlendModeManager} + * + * @member {PIXI.BlendModeManager} */ this.blendModeManager = new BlendModeManager(this); /** * Holds the current render target - * @member {Object} + * + * @member {PIXI.RenderTarget} */ this.currentRenderTarget = null; /** - * object renderer @alvin - * @member {ObjectRenderer} + * The currently active ObjectRenderer. + * + * @member {PIXI.ObjectRenderer} */ this.currentRenderer = new ObjectRenderer(this); @@ -149,7 +152,7 @@ /** * An array of render targets - * @member {Array} + * @member {PIXI.RenderTarget[]} * @private */ this._renderTargetStack = []; @@ -163,6 +166,11 @@ WebGLRenderer.glContextId = 0; +/** + * Creates the gl context. + * + * @private + */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); this.gl = gl; @@ -180,6 +188,7 @@ /** * Creates the WebGL context + * * @private */ WebGLRenderer.prototype._initContext = function () @@ -216,7 +225,7 @@ /** * Renders the object to its webGL view * - * @param object {DisplayObject} the object to be rendered + * @param object {PIXI.DisplayObject} the object to be rendered */ WebGLRenderer.prototype.render = function (object) { @@ -271,8 +280,8 @@ /** * Renders a Display Object. * - * @param displayObject {DisplayObject} The DisplayObject to render - * @param renderTarget {RenderTarget} The render target to use to render this display object + * @param displayObject {PIXI.DisplayObject} The DisplayObject to render + * @param renderTarget {PIXI.RenderTarget} The render target to use to render this display object * */ WebGLRenderer.prototype.renderDisplayObject = function (displayObject, renderTarget, clear)//projection, buffer) @@ -299,8 +308,7 @@ /** * Changes the current renderer to the one given in parameter * - * @param objectRenderer {Object} TODO @alvin - * + * @param objectRenderer {PIXI.ObjectRenderer} The object renderer to use. */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { @@ -317,8 +325,7 @@ /** * Changes the current render target to the one given in parameter * - * @param renderTarget {RenderTarget} the new render target - * + * @param renderTarget {PIXI.RenderTarget} the new render target */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { @@ -356,7 +363,7 @@ /** * Updates and/or Creates a WebGL texture for the renderer's context. * - * @param texture {BaseTexture|Texture} the texture to update + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to update */ WebGLRenderer.prototype.updateTexture = function (texture) { @@ -412,7 +419,7 @@ /** * Deletes the texture from WebGL * - * @param texture {BaseTexture|Texture} the texture to destroy + * @param texture {PIXI.BaseTexture|PIXI.Texture} the texture to destroy */ WebGLRenderer.prototype.destroyTexture = function (texture) { @@ -432,7 +439,6 @@ /** * Handles a lost webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextLost = function (event) @@ -443,7 +449,6 @@ /** * Handles a restored webgl context * - * @param event {Event} * @private */ WebGLRenderer.prototype.handleContextRestored = function () diff --git a/src/core/renderers/webgl/filters/AbstractFilter.js b/src/core/renderers/webgl/filters/AbstractFilter.js index 9a3f78a..735b31a 100644 --- a/src/core/renderers/webgl/filters/AbstractFilter.js +++ b/src/core/renderers/webgl/filters/AbstractFilter.js @@ -15,7 +15,7 @@ /** * An array of shaders - * @member {Shader[]} + * @member {PIXI.Shader[]} * @private */ this.shaders = []; @@ -56,10 +56,10 @@ AbstractFilter.prototype.constructor = AbstractFilter; module.exports = AbstractFilter; -/* +/** * Grabs a shader from the current renderer - * @param renderer {WebGLRenderer} The renderer to retrieve the shader from * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the shader from */ AbstractFilter.prototype.getShader = function (renderer) { @@ -82,11 +82,12 @@ return shader; }; -/* +/** * Applies the filter - * @param renderer {WebGLRenderer} The renderer to retrieve the filter from - * @param input {RenderTarget} - * @param output {RenderTarget} + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} * @param clear {boolean} Whether or not we want to clear the outputTarget */ AbstractFilter.prototype.applyFilter = function (renderer, input, output, clear) @@ -107,10 +108,3 @@ this.shaders[i].syncUniform(uniform); } }; - -/* -AbstractFilter.prototype.apply = function (frameBuffer) -{ - // TODO :) -}; -*/ diff --git a/src/core/renderers/webgl/filters/FXAAFilter.js b/src/core/renderers/webgl/filters/FXAAFilter.js index 253b6ed..6d5646c 100644 --- a/src/core/renderers/webgl/filters/FXAAFilter.js +++ b/src/core/renderers/webgl/filters/FXAAFilter.js @@ -36,6 +36,13 @@ FXAAFilter.prototype.constructor = FXAAFilter; module.exports = FXAAFilter; +/** + * Applies the filter + * + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} + */ FXAAFilter.prototype.applyFilter = function (renderer, input, output) { var filterManager = renderer.filterManager; diff --git a/src/core/renderers/webgl/filters/SpriteMaskFilter.js b/src/core/renderers/webgl/filters/SpriteMaskFilter.js index b1b93af..ae08ea9 100644 --- a/src/core/renderers/webgl/filters/SpriteMaskFilter.js +++ b/src/core/renderers/webgl/filters/SpriteMaskFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI - * @param sprite {Sprite} the target sprite + * @param sprite {PIXI.Sprite} the target sprite */ function SpriteMaskFilter(sprite) { @@ -35,11 +35,11 @@ module.exports = SpriteMaskFilter; /** - * Applies the filter ? @alvin + * Applies the filter * - * @param renderer {WebGLRenderer} A reference to the WebGL renderer - * @param input {RenderTarget} - * @param output {RenderTarget} + * @param renderer {PIXI.WebGLRenderer} The renderer to retrieve the filter from + * @param input {PIXI.RenderTarget} + * @param output {PIXI.RenderTarget} */ SpriteMaskFilter.prototype.applyFilter = function (renderer, input, output) { @@ -62,8 +62,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof SpriteMaskFilter# + * @member {PIXI.Texture} + * @memberof PIXI.SpriteMaskFilter# */ map: { get: function () @@ -79,8 +79,8 @@ /** * The offset used to move the displacement map. * - * @member {Point} - * @memberof SpriteMaskFilter# + * @member {PIXI.Point} + * @memberof PIXI.SpriteMaskFilter# */ offset: { get: function() diff --git a/src/core/renderers/webgl/managers/BlendModeManager.js b/src/core/renderers/webgl/managers/BlendModeManager.js index 6941d83..0112a9d 100644 --- a/src/core/renderers/webgl/managers/BlendModeManager.js +++ b/src/core/renderers/webgl/managers/BlendModeManager.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGlManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function BlendModeManager(renderer) { @@ -23,7 +23,8 @@ /** * Sets-up the given blendMode from WebGL's point of view. * - * @param blendMode {number} the blendMode, should be a Pixi const, such as BlendModes.ADD + * @param blendMode {number} the blendMode, should be a Pixi const, such as `PIXI.BLEND_MODES.ADD`. See + * {@link PIXI.BLEND_MODES} for possible values. */ BlendModeManager.prototype.setBlendMode = function (blendMode) { diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index 950c371..00d2dac 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -8,14 +8,14 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function FilterManager(renderer) { WebGLManager.call(this, renderer); /** - * @member {any[]} + * @member {object[]} */ this.filterStack = []; @@ -26,15 +26,25 @@ }); /** - * @member {any[]} + * @member {PIXI.RenderTarget[]} */ this.texturePool = []; + /** + * The size of the texture + * + * @member {PIXI.Rectangle} + */ // listen for context and update necessary buffers //TODO make this dynamic! //TODO test this out by forces power of two? - this.textureSize = new math.Rectangle( 0, 0, renderer.width, renderer.height ); + this.textureSize = new math.Rectangle(0, 0, renderer.width, renderer.height); + /** + * The current frame + * + * @member {PIXI.Rectangle} + */ this.currentFrame = null; } @@ -56,7 +66,7 @@ }; /** - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @param buffer {ArrayBuffer} */ FilterManager.prototype.setFilterStack = function ( filterStack ) @@ -67,14 +77,15 @@ /** * Applies the filter and adds it to the current filter stack. * - * @param filterBlock {object} the filter that will be pushed to the current filter stack + * @param target {PIXI.DisplayObject} + * @param filters {PIXI.AbstractFiler[]} the filters that will be pushed to the current filter stack */ FilterManager.prototype.pushFilter = function (target, filters) { // get the bounds of the object.. // TODO replace clone with a copy to save object creation var bounds = target.filterArea ? target.filterArea.clone() : target.getBounds(); - + //bounds = bounds.clone(); // round off the rectangle to get a nice smoooooooth filter :) diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 4b393bf..66de86c 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function MaskManager(renderer) { @@ -24,7 +24,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param graphics {Graphics} + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ MaskManager.prototype.pushMask = function (target, maskData) @@ -43,7 +43,7 @@ /** * Removes the last mask from the mask stack and doesn't return it. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popMask = function (target, maskData) @@ -61,7 +61,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushSpriteMask = function (target, maskData) @@ -92,7 +92,7 @@ /** * Applies the Mask and adds it to the current filter stack. * - * @param target {RenderTarget} + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.pushStencilMask = function (target, maskData) @@ -102,7 +102,8 @@ /** * Removes the last filter from the filter stack and doesn't return it. - * @param target {RenderTarget} + * + * @param target {PIXI.RenderTarget} * @param maskData {any[]} */ MaskManager.prototype.popStencilMask = function (target, maskData) diff --git a/src/core/renderers/webgl/managers/ShaderManager.js b/src/core/renderers/webgl/managers/ShaderManager.js index 226552a..c37fb84 100644 --- a/src/core/renderers/webgl/managers/ShaderManager.js +++ b/src/core/renderers/webgl/managers/ShaderManager.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @extends PIXI.WebGLManager - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function ShaderManager(renderer) { @@ -46,7 +46,7 @@ this._currentId = -1; /** - * @member {Shader} + * @member {PIXI.Shader} * @private */ this.currentShader = null; @@ -89,7 +89,7 @@ /** * Takes the attributes given in parameters and uploads them. * - * @param attribs {Array} attribs + * @param attribs {any[]} attribs */ ShaderManager.prototype.setAttribs = function (attribs) { @@ -130,7 +130,7 @@ /** * Sets the current shader. * - * @param shader {Shader} the shader to upload + * @param shader {PIXI.Shader} the shader to upload */ ShaderManager.prototype.setShader = function (shader) { diff --git a/src/core/renderers/webgl/managers/StencilManager.js b/src/core/renderers/webgl/managers/StencilManager.js index 247f0ef..8ee11fa 100644 --- a/src/core/renderers/webgl/managers/StencilManager.js +++ b/src/core/renderers/webgl/managers/StencilManager.js @@ -4,7 +4,7 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLMaskManager(renderer) { @@ -17,9 +17,9 @@ module.exports = WebGLMaskManager; /** - * Changes the mask stack that is used by this manager - * @param stencilMaskStack {StencilMaskStack} The mask stack + * Changes the mask stack that is used by this manager. * + * @param stencilMaskStack {PIXI.StencilMaskStack} The mask stack */ WebGLMaskManager.prototype.setMaskStack = function ( stencilMaskStack ) { @@ -39,8 +39,8 @@ /** * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param graphics {Graphics} + * + * @param graphics {PIXI.Graphics} * @param webGLData {any[]} */ WebGLMaskManager.prototype.pushStencil = function (graphics, webGLData) @@ -134,8 +134,8 @@ /** * TODO this does not belong here! * - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.bindGraphics = function (graphics, webGLData) { @@ -199,8 +199,8 @@ /** * TODO @alvin - * @param graphics {Graphics} - * @param webGLData {Array} + * @param graphics {PIXI.Graphics} + * @param webGLData {any[]} */ WebGLMaskManager.prototype.popStencil = function (graphics, webGLData) { diff --git a/src/core/renderers/webgl/managers/WebGLManager.js b/src/core/renderers/webgl/managers/WebGLManager.js index 2e072fc..0d75102 100644 --- a/src/core/renderers/webgl/managers/WebGLManager.js +++ b/src/core/renderers/webgl/managers/WebGLManager.js @@ -1,14 +1,14 @@ /** * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function WebGLManager(renderer) { /** * The renderer this manager works for. * - * @member {WebGLRenderer} + * @member {PIXI.WebGLRenderer} */ this.renderer = renderer; diff --git a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js index 4cb97fa..bab6b27 100644 --- a/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/ComplexPrimitiveShader.js @@ -1,10 +1,12 @@ var Shader = require('./Shader'); /** + * This shader is used to draw complex primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. */ function ComplexPrimitiveShader(shaderManager) { diff --git a/src/core/renderers/webgl/shaders/PrimitiveShader.js b/src/core/renderers/webgl/shaders/PrimitiveShader.js index 4cd002c..16817d9 100644 --- a/src/core/renderers/webgl/shaders/PrimitiveShader.js +++ b/src/core/renderers/webgl/shaders/PrimitiveShader.js @@ -1,6 +1,8 @@ var Shader = require('./Shader'); /** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * * @class * @memberof PIXI * @extends PIXI.Shader diff --git a/src/core/renderers/webgl/shaders/Shader.js b/src/core/renderers/webgl/shaders/Shader.js index a33d7a8..6566bdd 100644 --- a/src/core/renderers/webgl/shaders/Shader.js +++ b/src/core/renderers/webgl/shaders/Shader.js @@ -2,9 +2,11 @@ var utils = require('../../../utils'); /** + * Base shader class for PIXI managed shaders. + * * @class * @memberof PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [uniforms] {object} Uniforms for this shader. @@ -98,7 +100,8 @@ }; /* - * Caches the locations of the uniform for reuse + * Caches the locations of the uniform for reuse. + * @param keys {string} the uniforms to cache */ Shader.prototype.cacheUniformLocations = function (keys) @@ -110,7 +113,8 @@ }; /* - * Caches the locations of the attribute for reuse + * Caches the locations of the attribute for reuse. + * @param keys {string} the attributes to cache */ Shader.prototype.cacheAttributeLocations = function (keys) @@ -136,7 +140,8 @@ }; /* - * Attaches the shaders and creates the program + * Attaches the shaders and creates the program. + * @return {WebGLProgram} */ Shader.prototype.compile = function () @@ -215,7 +220,7 @@ /** * Adds a new uniform * -* @param uniform {Object} the new uniform to attach +* @param uniform {object} the new uniform to attach */ Shader.prototype.syncUniform = function (uniform) { @@ -457,8 +462,9 @@ } }; -/* +/** * Updates the shader uniform values. + * */ Shader.prototype.syncUniforms = function () { diff --git a/src/core/renderers/webgl/shaders/TextureShader.js b/src/core/renderers/webgl/shaders/TextureShader.js index 37dfc2c..6dfb62f 100644 --- a/src/core/renderers/webgl/shaders/TextureShader.js +++ b/src/core/renderers/webgl/shaders/TextureShader.js @@ -4,7 +4,7 @@ * @class * @memberof PIXI * @extends PIXI.Shader - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The webgl shader manager this shader works for. * @param [vertexSrc] {string} The source of the vertex shader. * @param [fragmentSrc] {string} The source of the fragment shader. * @param [customUniforms] {object} Custom uniforms to use to augment the built-in ones. @@ -45,13 +45,15 @@ /** * The vertex shader. - * @member {Array} + * + * @member {string} */ vertexSrc = vertexSrc || TextureShader.defaultVertexSrc; /** * The fragment shader. - * @member {Array} + * + * @member {string} */ fragmentSrc = fragmentSrc || TextureShader.defaultFragmentSrc; @@ -63,6 +65,12 @@ TextureShader.prototype.constructor = TextureShader; module.exports = TextureShader; +/** + * The default vertex shader source + * + * @static + * @constant + */ TextureShader.defaultVertexSrc = [ 'precision lowp float;', 'attribute vec2 aVertexPosition;', @@ -81,6 +89,12 @@ '}' ].join('\n'); +/** + * The default fragment shader source + * + * @static + * @constant + */ TextureShader.defaultFragmentSrc = [ 'precision lowp float;', diff --git a/src/core/renderers/webgl/utils/ObjectRenderer.js b/src/core/renderers/webgl/utils/ObjectRenderer.js index a975fda..4b9ae57 100644 --- a/src/core/renderers/webgl/utils/ObjectRenderer.js +++ b/src/core/renderers/webgl/utils/ObjectRenderer.js @@ -6,7 +6,7 @@ * @class * @extends PIXI.WebGLManager * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this object renderer works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this object renderer works for. */ function ObjectRenderer(renderer) { @@ -48,6 +48,7 @@ /** * Renders an object * + * @param object {PIXI.DisplayObject} The object to render. */ ObjectRenderer.prototype.render = function (object) // jshint unused:false { diff --git a/src/core/renderers/webgl/utils/Quad.js b/src/core/renderers/webgl/utils/Quad.js index d708f16..5ed8440 100644 --- a/src/core/renderers/webgl/utils/Quad.js +++ b/src/core/renderers/webgl/utils/Quad.js @@ -1,5 +1,6 @@ /** * Helper class to create a quad + * * @class * @memberof PIXI * @param gl {WebGLRenderingContext} The gl context for this quad to use. @@ -83,8 +84,8 @@ /** * Maps two Rectangle to the quad - * @param rect {Rectangle} the first rectangle - * @param rect2 {Rectangle} the second rectangle + * @param rect {PIXI.Rectangle} the first rectangle + * @param rect2 {PIXI.Rectangle} the second rectangle */ Quad.prototype.map = function(rect, rect2) { diff --git a/src/core/renderers/webgl/utils/RenderTarget.js b/src/core/renderers/webgl/utils/RenderTarget.js index 63f6c54..382e4e1 100644 --- a/src/core/renderers/webgl/utils/RenderTarget.js +++ b/src/core/renderers/webgl/utils/RenderTarget.js @@ -14,7 +14,7 @@ * @param gl {WebGLRenderingContext} the current WebGL drawing context * @param width {number} the horizontal range of the filter * @param height {number} the vertical range of the filter - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the current resolution * @param root {boolean} Whether this object is the root element or not */ @@ -23,7 +23,8 @@ //TODO Resolution could go here ( eg low res blurs ) /** - * The current WebGL drawing context + * The current WebGL drawing context. + * * @member {WebGLRenderingContext} */ this.gl = gl; @@ -32,60 +33,71 @@ /** * A frame buffer + * * @member {WebGLFrameBuffer} */ this.frameBuffer = null; /** - * @member {Texture} + * The texture + * + * @member {PIXI.Texture} */ this.texture = null; /** * The size of the object as a rectangle - * @member {Rectangle} + * + * @member {PIXI.Rectangle} */ this.size = new math.Rectangle(0, 0, 1, 1); /** * The current resolution + * * @member {number} */ this.resolution = resolution || CONST.RESOLUTION; /** * The projection matrix - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.projectionMatrix = new math.Matrix(); /** * The object's transform - * @member {Matrix} + * + * @member {PIXI.Matrix} */ this.transform = null; /** + * The frame. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.frame = null; /** * The stencil buffer stores masking data for the render target + * * @member {WebGLRenderBuffer} */ this.stencilBuffer = null; /** * The data structure for the stencil masks - * @member {StencilMaskStack} + * + * @member {PIXI.StencilMaskStack} */ this.stencilMaskStack = new StencilMaskStack(); /** * Stores filter data for the render target - * @member {Array} + * + * @member {object[]} */ this.filterStack = [ { @@ -97,14 +109,17 @@ /** - * The scale mode + * The scale mode. + * * @member {number} - * @default CONST.SCALE_MODES.DEFAULT + * @default PIXI.SCALE_MODES.DEFAULT + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; /** * Whether this object is the root element or not + * * @member {boolean} */ this.root = root; @@ -147,7 +162,6 @@ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); } - this.resize(width, height); }; @@ -155,9 +169,10 @@ module.exports = RenderTarget; /** -* Clears the filter texture. -* -*/ + * Clears the filter texture. + * + * @param [bind=false] {boolean} Should we bind our framebuffer before clearing? + */ RenderTarget.prototype.clear = function(bind) { var gl = this.gl; @@ -171,20 +186,20 @@ }; /** -* Binds the stencil buffer. -* -*/ + * Binds the stencil buffer. + * + */ RenderTarget.prototype.attachStencilBuffer = function() { - if ( this.stencilBuffer ) + if (this.stencilBuffer) { return; } - /* - The stencil buffer is used for masking in pixi - lets create one and then add attach it to the framebuffer.. + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. */ if (!this.root) { @@ -198,9 +213,9 @@ }; /** -* Binds the buffers and initialises the viewport. -* -*/ + * Binds the buffers and initialises the viewport. + * + */ RenderTarget.prototype.activate = function() { //TOOD refactor usage of frame.. @@ -222,10 +237,10 @@ }; /** -* Updates the projection matrix based on a projection frame (which is a rectangle) -* -*/ -RenderTarget.prototype.calculateProjection = function( projectionFrame ) + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + */ +RenderTarget.prototype.calculateProjection = function (projectionFrame) { var pm = this.projectionMatrix; @@ -256,7 +271,7 @@ * @param width {Number} the new width of the texture * @param height {Number} the new height of the texture */ -RenderTarget.prototype.resize = function(width, height) +RenderTarget.prototype.resize = function (width, height) { width = width | 0; height = height | 0; @@ -293,7 +308,7 @@ * Destroys the render target. * */ -RenderTarget.prototype.destroy = function() +RenderTarget.prototype.destroy = function () { var gl = this.gl; gl.deleteFramebuffer( this.frameBuffer ); diff --git a/src/core/renderers/webgl/utils/StencilMaskStack.js b/src/core/renderers/webgl/utils/StencilMaskStack.js index 4be85f1..3bb8737 100644 --- a/src/core/renderers/webgl/utils/StencilMaskStack.js +++ b/src/core/renderers/webgl/utils/StencilMaskStack.js @@ -2,14 +2,14 @@ * Generic Mask Stack data structure * @class * @memberof PIXI - * @param renderer {WebGLRenderer} The renderer this manager works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this manager works for. */ function StencilMaskStack() { /** * The actual stack * - * @member {Array} + * @member {any[]} */ this.stencilStack = []; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 83c7b14..82219a9 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -18,7 +18,7 @@ * @class * @extends PIXI.Container * @memberof PIXI - * @param texture {Texture} The texture for this sprite + * @param texture {PIXI.Texture} The texture for this sprite */ function Sprite(texture) { @@ -30,14 +30,14 @@ * 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 {Point} + * @member {PIXI.Point} */ this.anchor = new math.Point(); /** * The texture that the sprite is using * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -62,22 +62,23 @@ * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.tint = 0xFFFFFF; /** - * The blend mode to be applied to the sprite. Apply a value of blendModes.NORMAL to reset the blend mode. + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = CONST.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. * - * @member {AbstractFilter} + * @member {PIXI.AbstractFilter|PIXI.Shader} */ this.shader = null; @@ -85,7 +86,7 @@ * An internal cached value of the tint. * * @member {number} - * @default [0xFFFFFF] + * @default 0xFFFFFF */ this.cachedTint = 0xFFFFFF; @@ -195,7 +196,7 @@ * * Renders the object using the WebGL renderer * -* @param renderer {WebGLRenderer} +* @param renderer {PIXI.WebGLRenderer} * @private */ Sprite.prototype._renderWebGL = function (renderer) @@ -207,8 +208,8 @@ /** * Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Sprite.prototype.getBounds = function (matrix) { @@ -326,6 +327,10 @@ return this._currentBounds; }; +/** + * Gets the local bounds of the sprite object. + * + */ Sprite.prototype.getLocalBounds = function () { this._bounds.x = -this._texture._frame.width * this.anchor.x; @@ -338,7 +343,7 @@ /** * Tests if a point is inside this sprite * -* @param point {Point} the point to test +* @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Sprite.prototype.containsPoint = function( point ) @@ -366,7 +371,7 @@ /** * Renders the object using the Canvas renderer * -* @param renderer {CanvasRenderer} The renderer +* @param renderer {PIXI.CanvasRenderer} The renderer * @private */ Sprite.prototype._renderCanvas = function (renderer) @@ -531,10 +536,10 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId */ Sprite.fromFrame = function (frameId) { @@ -553,8 +558,8 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id + * @param imageId {string} The image url of the texture + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id */ Sprite.fromImage = function (imageId, crossorigin, scaleMode) { diff --git a/src/core/sprites/webgl/SpriteRenderer.js b/src/core/sprites/webgl/SpriteRenderer.js index ffdf6ff..ad77a74 100644 --- a/src/core/sprites/webgl/SpriteRenderer.js +++ b/src/core/sprites/webgl/SpriteRenderer.js @@ -14,12 +14,13 @@ */ /** + * Renderer dedicated to drawing and batching sprites. * * @class * @private * @memberof PIXI * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function SpriteRenderer(renderer) { @@ -102,17 +103,16 @@ /** * The current sprites in the batch. * - * @member {Array} + * @member {PIXI.Sprite[]} */ this.sprites = []; /** * The default shader that is used if a sprite doesn't have a more specific one. * - * @member {Shader} + * @member {PIXI.Shader} */ this.shader = null; - } SpriteRenderer.prototype = Object.create(ObjectRenderer.prototype); @@ -151,7 +151,7 @@ /** * Renders the sprite object. * - * @param sprite {Sprite} the sprite to render when using this spritebatch + * @param sprite {PIXI.Sprite} the sprite to render when using this spritebatch */ SpriteRenderer.prototype.render = function (sprite) { @@ -386,7 +386,7 @@ * Draws the currently batches sprites. * * @private - * @param texture {Texture} + * @param texture {PIXI.Texture} * @param size {number} * @param startIndex {number} */ diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 948e35a..684a069 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -98,7 +98,7 @@ * The width of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ width: { get: function () @@ -121,7 +121,7 @@ * The height of the Text, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof Text# + * @memberof PIXI.Text# */ height: { get: function () @@ -163,7 +163,7 @@ * spiked text issues. Default is 'miter' (creates a sharp corner). * @param [style.miterLimit=10] {number} The miter limit to use when using the 'miter' lineJoin mode. This can reduce * or increase the spikiness of rendered text. - * @memberof Text# + * @memberof PIXI.Text# */ style: { get: function () @@ -215,7 +215,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 - * @memberof Text# + * @memberof PIXI.Text# */ text: { get: function() @@ -396,7 +396,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} */ Text.prototype.renderWebGL = function (renderer) { @@ -413,7 +413,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Text.prototype._renderCanvas = function (renderer) @@ -581,8 +581,8 @@ /** * Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the Text - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the Text + * @return {PIXI.Rectangle} the framing rectangle */ Text.prototype.getBounds = function (matrix) { diff --git a/src/core/textures/BaseTexture.js b/src/core/textures/BaseTexture.js index dc66e48..3d6248d 100644 --- a/src/core/textures/BaseTexture.js +++ b/src/core/textures/BaseTexture.js @@ -8,7 +8,7 @@ * @class * @memberof PIXI * @param source {Image|Canvas} the source object of the texture. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values * @param resolution {number} the resolution of the texture for devices with different pixel ratios */ function BaseTexture(source, scaleMode, resolution) @@ -60,8 +60,9 @@ /** * The scale mode to apply when scaling this texture * - * @member {{number}} - * @default scaleModes.LINEAR + * @member {number} + * @default PIXI.SCALE_MODES.LINEAR + * @see PIXI.SCALE_MODES */ this.scaleMode = scaleMode || CONST.SCALE_MODES.DEFAULT; @@ -368,8 +369,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param [crossorigin=(auto)] {boolean} Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param [scaleMode=scaleModes.DEFAULT] {number} See {@link SCALE_MODES} for possible values - * @return BaseTexture + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -409,8 +410,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return BaseTexture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return PIXI.BaseTexture */ BaseTexture.fromCanvas = function (canvas, scaleMode) { diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index fd91816..8d7dd7f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -32,7 +32,7 @@ * position a Container should be used: * * ```js - * var doc = new Container(); + * var doc = new PIXI.Container(); * * doc.addChild(sprite); * @@ -42,10 +42,10 @@ * @class * @extends PIXI.Texture * @memberof PIXI - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} The renderer used for this RenderTexture * @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 SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values * @param [resolution=1] {number} The resolution of the texture being generated */ function RenderTexture(renderer, width, height, scaleMode, resolution) @@ -100,21 +100,6 @@ this.resolution = resolution; /** - * The framing rectangle of the render texture - * - * @member {Rectangle} - */ - //this._frame = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {Rectangle} - */ - //this.crop = new math.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** * Draw/render the given DisplayObject onto the texture. * * The displayObject and descendents are transformed during this operation. @@ -125,8 +110,8 @@ * The display object is always rendered with a worldAlpha value of 1. * * @method - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -136,7 +121,7 @@ /** * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. * - * @member {CanvasRenderer|WebGLRenderer} + * @member {PIXI.CanvasRenderer|PIXI.WebGLRenderer} */ this.renderer = renderer; @@ -238,8 +223,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear=false] {boolean} If true the texture will be cleared before the displayObject is drawn * @param [updateTransform=true] {boolean} If true the displayObject's worldTransform/worldAlpha and all children * transformations will be restored. Not restoring this information will be a little faster. @@ -258,7 +243,7 @@ //TODO not a fan that this is here... it will move! this.textureBuffer.activate(); - + // setWorld Alpha to ensure that the object is renderer at full opacity displayObject.worldAlpha = 1; @@ -294,8 +279,8 @@ * Internal method assigned to the `render` property if using a CanvasRenderer. * * @private - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. + * @param displayObject {PIXI.DisplayObject} The display object to render this texture on + * @param [matrix] {PIXI.Matrix} Optional matrix to apply to the display object before rendering. * @param [clear] {boolean} If true the texture will be cleared before the displayObject is drawn */ RenderTexture.prototype.renderCanvas = function (displayObject, matrix, clear, updateTransform) diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 2738486..29ebc47 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -19,10 +19,10 @@ * * @class * @memberof PIXI - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle + * @param baseTexture {PIXI.BaseTexture} The base texture source to create the texture from + * @param [frame] {PIXI.Rectangle} The rectangle frame of the texture to show + * @param [crop] {PIXI.Rectangle} The area of original texture + * @param [trim] {PIXI.Rectangle} Trimmed texture rectangle * @param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer ) */ function Texture(baseTexture, frame, crop, trim, rotate) @@ -47,19 +47,17 @@ baseTexture = baseTexture.baseTexture; } - // console.log(frame); - /** * The base texture that this texture uses. * - * @member {BaseTexture} + * @member {PIXI.BaseTexture} */ this.baseTexture = baseTexture; /** * The frame specifies the region of the base texture that this texture uses * - * @member {Rectangle} + * @member {PIXI.Rectangle} * @private */ this._frame = frame; @@ -67,7 +65,7 @@ /** * The texture trim data. * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.trim = trim; @@ -88,7 +86,7 @@ /** * The WebGL UV data cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = null; @@ -111,7 +109,7 @@ * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) * - * @member {Rectangle} + * @member {PIXI.Rectangle} */ this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); @@ -153,6 +151,12 @@ module.exports = Texture; Object.defineProperties(Texture.prototype, { + /** + * The frame specifies the region of the base texture that this texture uses. + * + * @member {PIXI.Rectangle} + * @memberof PIXI.Texture# + */ frame: { get: function () { @@ -167,8 +171,6 @@ this.width = frame.width; this.height = frame.height; - - if (!this.trim && !this.rotate && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); @@ -179,7 +181,6 @@ if (this.trim) { - this.width = this.trim.width; this.height = this.trim.height; this._frame.width = this.trim.width; @@ -227,6 +228,11 @@ this.emit('update', this); }; +/** + * Called when the base texture is updated + * + * @private + */ Texture.prototype.onBaseTextureUpdated = function (baseTexture) { this._frame.width = baseTexture.width; @@ -238,7 +244,7 @@ /** * Destroys this texture * - * @param destroyBase {boolean} Whether to destroy the base texture as well + * @param [destroyBase=false] {boolean} Whether to destroy the base texture as well */ Texture.prototype.destroy = function (destroyBase) { @@ -263,6 +269,11 @@ this.valid = false; }; +/** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} + */ Texture.prototype.clone = function () { return new Texture(this.baseTexture, this.frame, this.crop, this.trim, this.rotate); @@ -290,8 +301,8 @@ * @static * @param imageUrl {string} The image url of the texture * @param crossorigin {boolean} Whether requests should be treated as crossorigin - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} The newly created texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture */ Texture.fromImage = function (imageUrl, crossorigin, scaleMode) { @@ -311,8 +322,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {Texture} The newly created texture + * @param frameId {string} The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture */ Texture.fromFrame = function (frameId) { @@ -331,8 +342,8 @@ * * @static * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} */ Texture.fromCanvas = function (canvas, scaleMode) { @@ -344,8 +355,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {{#crossLink "PIXI/scaleModes:property"}}scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideo = function (video, scaleMode) { @@ -364,8 +375,8 @@ * * @static * @param videoUrl {string} - * @param scaleMode {number} See {{@link SCALE_MODES}} for possible values - * @return {Texture} A Texture + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} A Texture */ Texture.fromVideoUrl = function (videoUrl, scaleMode) { @@ -376,7 +387,7 @@ * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * * @static - * @param texture {Texture} The Texture to add to the cache. + * @param texture {PIXI.Texture} The Texture to add to the cache. * @param id {string} The id that the texture will be stored against. */ Texture.addTextureToCache = function (texture, id) @@ -389,7 +400,7 @@ * * @static * @param id {string} The id of the texture to be removed - * @return {Texture} The texture that was removed + * @return {PIXI.Texture} The texture that was removed */ Texture.removeTextureFromCache = function (id) { @@ -401,4 +412,10 @@ return texture; }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * + * @static + * @constant + */ Texture.EMPTY = new Texture(new BaseTexture()); diff --git a/src/core/textures/TextureUvs.js b/src/core/textures/TextureUvs.js index 7d1e8b2..b3a5f7f 100644 --- a/src/core/textures/TextureUvs.js +++ b/src/core/textures/TextureUvs.js @@ -4,6 +4,7 @@ * * @class * @private + * @memberof PIXI */ function TextureUvs() { @@ -24,8 +25,8 @@ /** * Sets the texture Uvs based on the given frame information - * @param frame {Rectangle} - * @param baseFrame {Rectangle} + * @param frame {PIXI.Rectangle} + * @param baseFrame {PIXI.Rectangle} * @param rotate {boolean} Whether or not the frame is rotated * @private */ diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 03d887c..d74b2e7 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -27,7 +27,7 @@ * @extends PIXI.BaseTexture * @memberof PIXI * @param source {HTMLVideoElement} - * @param [scaleMode] {number} See {@link SCALE_MODES} for possible values + * @param [scaleMode] {number} See {@link PIXI.SCALE_MODES} for possible values */ function VideoBaseTexture(source, scaleMode) { @@ -76,6 +76,7 @@ /** * The internal update loop of the video base texture, only runs when autoUpdate is set to true + * * @private */ VideoBaseTexture.prototype._onUpdate = function () @@ -89,6 +90,7 @@ /** * Runs the update loop when the video is ready to play + * * @private */ VideoBaseTexture.prototype._onPlayStart = function () @@ -102,6 +104,7 @@ /** * Fired when a pause event is triggered, stops the update loop + * * @private */ VideoBaseTexture.prototype._onPlayStop = function () @@ -111,6 +114,7 @@ /** * Fired when the video is loaded and ready to play + * * @private */ VideoBaseTexture.prototype._onCanPlay = function () @@ -156,8 +160,8 @@ * * @static * @param video {HTMLVideoElement} - * @param scaleMode {number} See {@link SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromVideo = function (video, scaleMode) { @@ -186,8 +190,8 @@ * @param [videoSrc.src] {string} One of the source urls for the video * @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 SCALE_MODES} for possible values - * @return {VideoBaseTexture} + * @param scaleMode {number} See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.VideoBaseTexture} */ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { diff --git a/src/core/ticker/Ticker.js b/src/core/ticker/Ticker.js index 2528897..7d1436e 100644 --- a/src/core/ticker/Ticker.js +++ b/src/core/ticker/Ticker.js @@ -16,6 +16,7 @@ function Ticker() { var _this = this; + /** * Internal tick method bound to ticker instance. * This is because in early 2015, Function.bind @@ -41,16 +42,19 @@ } } }; + /** * Internal emitter used to fire 'tick' event * @private */ this._emitter = new EventEmitter(); + /** * Internal current frame request ID * @private */ this._requestId = null; + /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. diff --git a/src/core/utils/pluginTarget.js b/src/core/utils/pluginTarget.js index b291718..77fe44b 100644 --- a/src/core/utils/pluginTarget.js +++ b/src/core/utils/pluginTarget.js @@ -17,7 +17,7 @@ * Adds a plugin to an object * * @param pluginName {string} The events that should be listed. - * @param ctor {Object} ?? @alvin + * @param ctor {Function} The constructor function for the plugin. */ obj.registerPlugin = function (pluginName, ctor) { diff --git a/src/deprecation.js b/src/deprecation.js index dc5b544..85311ec 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -10,6 +10,7 @@ * @name PIXI.SpriteBatch * @see {@link PIXI.ParticleContainer} * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 */ core.SpriteBatch = function() { @@ -22,6 +23,7 @@ * @name PIXI.AssetLoader * @see {@link PIXI.loaders.Loader} * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 */ core.AssetLoader = function() { @@ -34,8 +36,8 @@ * @class * @private * @name PIXI.Stage - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ Stage: { get: function() @@ -49,8 +51,8 @@ * @class * @private * @name PIXI.DisplayObjectContainer - * @see {@link PIXI.Container} - * @deprecated since version 3.0 + * @see PIXI.Container + * @deprecated since version 3.0.0 */ DisplayObjectContainer: { get: function() @@ -64,8 +66,8 @@ * @class * @private * @name PIXI.Strip - * @see {@link PIXI.mesh.Mesh} - * @deprecated since version 3.0 + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 */ Strip: { get: function() @@ -79,8 +81,8 @@ * @class * @private * @name PIXI.Rope - * @see {@link PIXI.mesh.Rope} - * @deprecated since version 3.0 + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 */ Rope: { get: function() @@ -94,8 +96,8 @@ * @class * @private * @name PIXI.MovieClip - * @see {@link PIXI.MovieClip} - * @deprecated since version 3.0 + * @see PIXI.MovieClip + * @deprecated since version 3.0.0 */ MovieClip: { get: function() @@ -109,8 +111,8 @@ * @class * @private * @name PIXI.TilingSprite - * @see {@link PIXI.TilingSprite} - * @deprecated since version 3.0 + * @see PIXI.TilingSprite + * @deprecated since version 3.0.0 */ TilingSprite: { get: function() @@ -124,8 +126,8 @@ * @class * @private * @name PIXI.BitmapText - * @see {@link PIXI.extras.BitmapText} - * @deprecated since version 3.0 + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 */ BitmapText: { get: function() @@ -139,8 +141,8 @@ * @class * @private * @name PIXI.blendModes - * @see {@link PIXI.BLEND_MODES} - * @deprecated since version 3.0 + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 */ blendModes: { get: function() @@ -154,8 +156,8 @@ * @class * @private * @name PIXI.scaleModes - * @see {@link PIXI.SCALE_MODES} - * @deprecated since version 3.0 + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 */ scaleModes: { get: function() @@ -169,8 +171,8 @@ * @class * @private * @name PIXI.BaseTextureCache - * @see {@link PIXI.utils.BaseTextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 */ BaseTextureCache: { get: function () @@ -184,8 +186,8 @@ * @class * @private * @name PIXI.TextureCache - * @see {@link PIXI.utils.TextureCache} - * @deprecated since version 3.0 + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 */ TextureCache: { get: function () @@ -199,7 +201,7 @@ * @namespace * @private * @name PIXI.math - * @see {@link PIXI} + * @see PIXI * @deprecated since version 3.0.6 */ math: { @@ -215,8 +217,8 @@ * @method * @private * @name PIXI.Sprite#setTexture - * @see {@link PIXI.Sprite#texture} - * @deprecated since version 3.0 + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 */ core.Sprite.prototype.setTexture = function(texture) { @@ -227,8 +229,8 @@ /** * @method * @name PIXI.extras.BitmapText#setText - * @see {@link PIXI.BitmapText#text} - * @deprecated since version 3.0 + * @see PIXI.BitmapText#text + * @deprecated since version 3.0.0 */ extras.BitmapText.prototype.setText = function(text) { @@ -239,8 +241,8 @@ /** * @method * @name PIXI.Text#setText - * @see {@link PIXI.Text#text} - * @deprecated since version 3.0 + * @see PIXI.Text#text + * @deprecated since version 3.0.0 */ core.Text.prototype.setText = function(text) { @@ -251,8 +253,8 @@ /** * @method * @name PIXI.Text#setStyle - * @see {@link PIXI.Text#style} - * @deprecated since version 3.0 + * @see PIXI.Text#style + * @deprecated since version 3.0.0 */ core.Text.prototype.setStyle = function(style) { @@ -263,8 +265,8 @@ /** * @method * @name PIXI.Texture#setFrame - * @see {@link PIXI.Texture#setFrame} - * @deprecated since version 3.0 + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 */ core.Texture.prototype.setFrame = function(frame) { @@ -278,7 +280,7 @@ * @class * @private * @name PIXI.filters.AbstractFilter - * @see {@link PIXI.AbstractFilter} + * @see PIXI.AbstractFilter * @deprecated since version 3.0.6 */ AbstractFilter: { @@ -293,7 +295,7 @@ * @class * @private * @name PIXI.filters.FXAAFilter - * @see {@link PIXI.FXAAFilter} + * @see PIXI.FXAAFilter * @deprecated since version 3.0.6 */ FXAAFilter: { @@ -308,7 +310,7 @@ * @class * @private * @name PIXI.filters.SpriteMaskFilter - * @see {@link PIXI.SpriteMaskFilter} + * @see PIXI.SpriteMaskFilter * @deprecated since version 3.0.6 */ SpriteMaskFilter: { @@ -323,7 +325,7 @@ /** * @method * @name PIXI.utils.uuid - * @see {@link PIXI.utils.uid} + * @see PIXI.utils.uid * @deprecated since version 3.0.6 */ core.utils.uuid = function () diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index fd53f2b..fd2d010 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -55,7 +55,7 @@ /** * Private tracker for the letter sprite pool. * - * @member {Sprite[]} + * @member {PIXI.Sprite[]} * @private */ this._glyphs = []; @@ -117,7 +117,7 @@ * The tint of the BitmapText object * * @member {number} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ tint: { get: function () @@ -137,7 +137,7 @@ * * @member {string} * @default 'left' - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ align: { get: function () @@ -156,7 +156,7 @@ * The font descriptor of the BitmapText object * * @member {Font} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ font: { get: function () @@ -188,7 +188,7 @@ * The text of the BitmapText object * * @member {string} - * @memberof BitmapText# + * @memberof PIXI.BitmapText# */ text: { get: function () @@ -351,7 +351,7 @@ /** * Validates text before calling parent's getLocalBounds * - * @return {Rectangle} The rectangular bounding area + * @return {PIXI.Rectangle} The rectangular bounding area */ BitmapText.prototype.getLocalBounds = function() diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 26bceea..9fc0ed2 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -50,7 +50,7 @@ * Function to call when a MovieClip finishes playing * * @method - * @memberof MovieClip# + * @memberof PIXI.extras.MovieClip# */ this.onComplete = null; @@ -82,7 +82,7 @@ * assigned to the MovieClip. * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @default 0 * @readonly */ @@ -97,7 +97,7 @@ * The array of textures used for this MovieClip * * @member {PIXI.Texture[]} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * */ textures: { @@ -117,7 +117,7 @@ * The MovieClips current frame index * * @member {number} - * @memberof PIXI.MovieClip# + * @memberof PIXI.extras.MovieClip# * @readonly */ currentFrame: { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 3832373..9d36910 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,7 +19,7 @@ /** * The scaling of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tileScale = new core.Point(1,1); @@ -27,7 +27,7 @@ /** * The offset position of the image that is being tiled * - * @member {Point} + * @member {PIXI.Point} */ this.tilePosition = new core.Point(0,0); @@ -52,7 +52,7 @@ /** * An internal WebGL UV cache. * - * @member {TextureUvs} + * @member {PIXI.TextureUvs} * @private */ this._uvs = new core.TextureUvs(); @@ -126,7 +126,7 @@ * The width of the sprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ width: { get: function () @@ -143,7 +143,7 @@ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set * * @member {number} - * @memberof TilingSprite# + * @memberof PIXI.extras.TilingSprite# */ height: { get: function () @@ -166,7 +166,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {PIXI.WebGLRenderer} * @private */ TilingSprite.prototype._renderWebGL = function (renderer) @@ -213,7 +213,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} a reference to the canvas renderer + * @param renderer {PIXI.CanvasRenderer} a reference to the canvas renderer * @private */ TilingSprite.prototype._renderCanvas = function (renderer) @@ -282,7 +282,7 @@ /** * Returns the framing rectangle of the sprite as a Rectangle object * - * @return {Rectangle} the framing rectangle + * @return {PIXI.Rectangle} the framing rectangle */ TilingSprite.prototype.getBounds = function () { @@ -357,7 +357,7 @@ /** * Checks if a point is inside this tiling sprite - * @param point {Point} the point to check + * @param point {PIXI.Point} the point to check */ TilingSprite.prototype.containsPoint = function( point ) { @@ -400,8 +400,8 @@ * The frame ids are created when a Texture packer file has been loaded * * @static - * @param frameId {String} The frame Id of the texture in the cache - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + * @param frameId {string} The frame Id of the texture in the cache + * @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 */ @@ -422,12 +422,12 @@ * If the image is not in the texture cache it will be loaded * * @static - * @param imageId {String} The image url of the texture + * @param imageId {string} The image url of the texture * @param width {number} the width of the tiling sprite * @param height {number} the height of the tiling sprite * @param [crossorigin=(auto)] {boolean} if you want to specify the cross-origin parameter - * @param [scaleMode=scaleModes.DEFAULT] {number} if you want to specify the scale mode, see {@link SCALE_MODES} for possible values - * @return {TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + * @param [scaleMode=PIXI.SCALE_MODES.DEFAULT] {number} if you want to specify the scale mode, see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id */ TilingSprite.fromImage = function (imageId, width, height, crossorigin, scaleMode) { diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 36e51d7..220b6cd 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -19,7 +19,7 @@ * To remove simply set this property to 'null' * * @member {boolean} - * @memberof DisplayObject# + * @memberof PIXI.DisplayObject# */ cacheAsBitmap: { get: function () @@ -75,7 +75,7 @@ /** * Renders a cached version of the sprite with WebGL * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._renderCachedWebGL = function (renderer) @@ -96,7 +96,7 @@ /** * Prepares the WebGL renderer to cache the sprite * -* @param renderer {WebGLRenderer} the WebGL renderer +* @param renderer {PIXI.WebGLRenderer} the WebGL renderer * @private */ DisplayObject.prototype._initCachedDisplayObject = function (renderer) @@ -172,7 +172,7 @@ /** * Renders a cached version of the sprite with canvas * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._renderCachedCanvas = function (renderer) @@ -181,7 +181,7 @@ { return; } - + this._initCachedDisplayObjectCanvas( renderer ); this._cachedSprite.worldAlpha = this.worldAlpha; @@ -193,7 +193,7 @@ /** * Prepares the Canvas renderer to cache the sprite * -* @param renderer {CanvasRenderer} the Canvas renderer +* @param renderer {PIXI.CanvasRenderer} the Canvas renderer * @private */ DisplayObject.prototype._initCachedDisplayObjectCanvas = function (renderer) diff --git a/src/extras/getChildByName.js b/src/extras/getChildByName.js index ea59377..17ff796 100644 --- a/src/extras/getChildByName.js +++ b/src/extras/getChildByName.js @@ -3,6 +3,7 @@ /** * The instance name of the object. * + * @memberof PIXI.DisplayObject# * @member {string} */ core.DisplayObject.prototype.name = null; @@ -10,14 +11,15 @@ /** * Returns the display object in the container * +* @memberof PIXI.Container# * @param name {string} instance name -* @return {DisplayObject} +* @return {PIXI.DisplayObject} */ core.Container.prototype.getChildByName = function (name) { - for (var i = 0; i < this.children.length; i++) + for (var i = 0; i < this.children.length; i++) { - if (this.children[i].name === name) + if (this.children[i].name === name) { return this.children[i]; } diff --git a/src/extras/getGlobalPosition.js b/src/extras/getGlobalPosition.js index 0a7dc1c..0d03c4f 100644 --- a/src/extras/getGlobalPosition.js +++ b/src/extras/getGlobalPosition.js @@ -3,6 +3,7 @@ /** * Returns the global position of the displayObject * +* @memberof PIXI.DisplayObject# * @param point {Point} the point to write the global value to. If null a new point will be returned * @return {Point} */ diff --git a/src/filters/ascii/AsciiFilter.js b/src/filters/ascii/AsciiFilter.js index 8612c14..90c185e 100644 --- a/src/filters/ascii/AsciiFilter.js +++ b/src/filters/ascii/AsciiFilter.js @@ -40,7 +40,7 @@ * The pixel size used by the filter. * * @member {number} - * @memberof AsciiFilter# + * @memberof PIXI.filters.AsciiFilter# */ size: { get: function () diff --git a/src/filters/bloom/BloomFilter.js b/src/filters/bloom/BloomFilter.js index 3e42cd4..966b407 100644 --- a/src/filters/bloom/BloomFilter.js +++ b/src/filters/bloom/BloomFilter.js @@ -47,7 +47,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blur: { @@ -65,7 +65,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurX: { @@ -83,7 +83,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BloomFilter# + * @memberOf PIXI.filters.BloomFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurDirFilter.js b/src/filters/blur/BlurDirFilter.js index a0bcc8e..a0f2f07 100644 --- a/src/filters/blur/BlurDirFilter.js +++ b/src/filters/blur/BlurDirFilter.js @@ -31,7 +31,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurDirFilter# * @default 1 */ this.passes = 1; @@ -40,7 +39,6 @@ * Sets the X direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirX = dirX || 0; @@ -49,7 +47,6 @@ * Sets the Y direction of the blur * * @member {number} - * @memberof BlurDirFilter# * @default 0 */ this.dirY = dirY || 0; @@ -92,7 +89,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 2 */ blur: { @@ -110,7 +107,7 @@ * Sets the X direction of the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 0 */ dirX: { @@ -127,7 +124,7 @@ * Sets the Y direction of the blur. * * @member {number} - * @memberof BlurDirFilter# + * @memberof PIXI.filters.BlurDirFilter# * @default 0 */ dirY: { diff --git a/src/filters/blur/BlurFilter.js b/src/filters/blur/BlurFilter.js index dd8f5b9..37d7292 100644 --- a/src/filters/blur/BlurFilter.js +++ b/src/filters/blur/BlurFilter.js @@ -37,7 +37,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blur: { @@ -56,7 +56,7 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 1 */ passes: { @@ -74,7 +74,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurX: { @@ -92,7 +92,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf BlurFilter# + * @memberOf PIXI.filters.BlurFilter# * @default 2 */ blurY: { diff --git a/src/filters/blur/BlurXFilter.js b/src/filters/blur/BlurXFilter.js index af0dec2..b512a92 100644 --- a/src/filters/blur/BlurXFilter.js +++ b/src/filters/blur/BlurXFilter.js @@ -26,7 +26,6 @@ * Sets the number of passes for blur. More passes means higher quaility bluring. * * @member {number} - * @memberof BlurXFilter# * @default 1 */ this.passes = 1; @@ -75,7 +74,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurXFilter# + * @memberof PIXI.filters.BlurXFilter# * @default 2 */ blur: { diff --git a/src/filters/blur/BlurYFilter.js b/src/filters/blur/BlurYFilter.js index cb6be43..588c785 100644 --- a/src/filters/blur/BlurYFilter.js +++ b/src/filters/blur/BlurYFilter.js @@ -67,7 +67,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYFilter# * @default 2 */ blur: { diff --git a/src/filters/color/ColorMatrixFilter.js b/src/filters/color/ColorMatrixFilter.js index d945de3..c87adf5 100644 --- a/src/filters/color/ColorMatrixFilter.js +++ b/src/filters/color/ColorMatrixFilter.js @@ -67,10 +67,10 @@ /** * Multiplies two mat5's * - * @param out {array} (mat 5x4) the receiving matrix - * @param a {array} (mat 5x4) the first operand - * @param b {array} (mat 5x4) the second operand - * @returns out {array} (mat 5x4) + * @param out {number[]} (mat 5x4) the receiving matrix + * @param a {number[]} (mat 5x4) the first operand + * @param b {number[]} (mat 5x4) the second operand + * @returns out {number[]} (mat 5x4) */ ColorMatrixFilter.prototype._multiply = function (out, a, b) { @@ -127,7 +127,6 @@ /** * Adjusts brightness * - * Multiply the current matrix * @param b {number} value of the brigthness (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -146,7 +145,6 @@ /** * Set the matrices in grey scales * - * Multiply the current matrix * @param scale {number} value of the grey (0 is black) * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -185,7 +183,6 @@ /** * Set the hue property of the color * - * Multiply the current matrix * @param rotation {number} in degrees * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -237,6 +234,7 @@ /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness + * * @param amount {number} * @param multiply {boolean} refer to ._loadMatrix() method */ @@ -499,8 +497,6 @@ }; /* - * Reset function - * * Erase the current matrix by setting the default one * */ @@ -522,7 +518,7 @@ * Sets the matrix of the color matrix filter * * @member {number[]} - * @memberof ColorMatrixFilter# + * @memberof PIXI.filters.ColorMatrixFilter# * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ matrix: { diff --git a/src/filters/color/ColorStepFilter.js b/src/filters/color/ColorStepFilter.js index 7eef1b1..ecef38a 100644 --- a/src/filters/color/ColorStepFilter.js +++ b/src/filters/color/ColorStepFilter.js @@ -32,7 +32,7 @@ * The number of steps to reduce the palette by. * * @member {number} - * @memberof ColorStepFilter# + * @memberof PIXI.filters.ColorStepFilter# */ step: { get: function () diff --git a/src/filters/convolution/ConvolutionFilter.js b/src/filters/convolution/ConvolutionFilter.js index 9bb60e6..dba9bb9 100644 --- a/src/filters/convolution/ConvolutionFilter.js +++ b/src/filters/convolution/ConvolutionFilter.js @@ -40,7 +40,7 @@ * An array of values used for matrix transformation. Specified as a 9 point Array. * * @member {number[]} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ matrix: { get: function () @@ -57,7 +57,7 @@ * Width of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ width: { get: function () @@ -74,7 +74,7 @@ * Height of the object you are transforming * * @member {number} - * @memberof ConvolutionFilter# + * @memberof PIXI.filters.ConvolutionFilter# */ height: { get: function () diff --git a/src/filters/displacement/DisplacementFilter.js b/src/filters/displacement/DisplacementFilter.js index 5e5b290..662ac83 100644 --- a/src/filters/displacement/DisplacementFilter.js +++ b/src/filters/displacement/DisplacementFilter.js @@ -10,7 +10,7 @@ * @class * @extends PIXI.AbstractFilter * @memberof PIXI.filters - * @param sprite {Sprite} the sprite used for the displacement map. (make sure its added to the scene!) + * @param sprite {PIXI.Sprite} the sprite used for the displacement map. (make sure its added to the scene!) */ function DisplacementFilter(sprite, scale) { @@ -65,8 +65,8 @@ /** * The texture used for the displacement map. Must be power of 2 sized texture. * - * @member {Texture} - * @memberof DisplacementFilter# + * @member {PIXI.Texture} + * @memberof PIXI.filters.DisplacementFilter# */ map: { get: function () diff --git a/src/filters/dot/DotScreenFilter.js b/src/filters/dot/DotScreenFilter.js index fad4fdc..7894c79 100644 --- a/src/filters/dot/DotScreenFilter.js +++ b/src/filters/dot/DotScreenFilter.js @@ -39,7 +39,7 @@ /** * The scale of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ scale: { get: function () @@ -55,7 +55,7 @@ /** * The radius of the effect. * @member {number} - * @memberof DotScreenFilter# + * @memberof PIXI.filters.DotScreenFilter# */ angle: { get: function () diff --git a/src/filters/dropshadow/BlurYTintFilter.js b/src/filters/dropshadow/BlurYTintFilter.js index efcfbc6..9767b01 100644 --- a/src/filters/dropshadow/BlurYTintFilter.js +++ b/src/filters/dropshadow/BlurYTintFilter.js @@ -72,7 +72,7 @@ * Sets the strength of both the blur. * * @member {number} - * @memberof BlurYFilter# + * @memberof PIXI.filters.BlurYTintFilter# * @default 2 */ blur: { diff --git a/src/filters/dropshadow/DropShadowFilter.js b/src/filters/dropshadow/DropShadowFilter.js index 03b478f..e34b223 100644 --- a/src/filters/dropshadow/DropShadowFilter.js +++ b/src/filters/dropshadow/DropShadowFilter.js @@ -69,7 +69,7 @@ * Sets the strength of both the blurX and blurY properties simultaneously * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blur: { @@ -87,7 +87,7 @@ * Sets the strength of the blurX property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurX: { @@ -105,7 +105,7 @@ * Sets the strength of the blurY property * * @member {number} - * @memberOf DropShadowFilter# + * @memberOf PIXI.filters.DropShadowFilter# * @default 2 */ blurY: { @@ -119,6 +119,12 @@ } }, + /** + * Sets the color of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ color: { get: function () { @@ -130,6 +136,12 @@ } }, + /** + * Sets the alpha of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ alpha: { get: function () { @@ -141,6 +153,12 @@ } }, + /** + * Sets the distance of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ distance: { get: function () { @@ -153,6 +171,12 @@ } }, + /** + * Sets the angle of the shadow + * + * @member {number} + * @memberOf PIXI.filters.DropShadowFilter# + */ angle: { get: function () { diff --git a/src/filters/gray/GrayFilter.js b/src/filters/gray/GrayFilter.js index d1dd6ac..382cc4f 100644 --- a/src/filters/gray/GrayFilter.js +++ b/src/filters/gray/GrayFilter.js @@ -32,7 +32,7 @@ * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. * * @member {number} - * @memberof GrayFilter# + * @memberof PIXI.filters.GrayFilter# */ gray: { get: function () diff --git a/src/filters/invert/InvertFilter.js b/src/filters/invert/InvertFilter.js index 53946f7..4c0fbc5 100644 --- a/src/filters/invert/InvertFilter.js +++ b/src/filters/invert/InvertFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof InvertFilter# + * @memberof PIXI.filters.InvertFilter# */ invert: { get: function () diff --git a/src/filters/noise/NoiseFilter.js b/src/filters/noise/NoiseFilter.js index 974b9c5..044a186 100644 --- a/src/filters/noise/NoiseFilter.js +++ b/src/filters/noise/NoiseFilter.js @@ -37,7 +37,7 @@ * The amount of noise to apply. * * @member {number} - * @memberof NoiseFilter# + * @memberof PIXI.filters.NoiseFilter# * @default 0.5 */ noise: { diff --git a/src/filters/pixelate/PixelateFilter.js b/src/filters/pixelate/PixelateFilter.js index 385be42..7db085d 100644 --- a/src/filters/pixelate/PixelateFilter.js +++ b/src/filters/pixelate/PixelateFilter.js @@ -33,8 +33,8 @@ * This a point that describes the size of the blocks. * x is the width of the block and y is the height. * - * @member {Point} - * @memberof PixelateFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.PixelateFilter# */ size: { get: function () diff --git a/src/filters/rgb/RGBSplitFilter.js b/src/filters/rgb/RGBSplitFilter.js index d623624..7d4e3f2 100644 --- a/src/filters/rgb/RGBSplitFilter.js +++ b/src/filters/rgb/RGBSplitFilter.js @@ -34,8 +34,8 @@ /** * Red channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ red: { get: function () @@ -51,8 +51,8 @@ /** * Green channel offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ green: { get: function () @@ -68,8 +68,8 @@ /** * Blue offset. * - * @member {Point} - * @memberof RGBSplitFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.RGBSplitFilter# */ blue: { get: function () diff --git a/src/filters/sepia/SepiaFilter.js b/src/filters/sepia/SepiaFilter.js index a3ead4e..74e2970 100644 --- a/src/filters/sepia/SepiaFilter.js +++ b/src/filters/sepia/SepiaFilter.js @@ -33,7 +33,7 @@ * `0` will make the object its normal color. * * @member {number} - * @memberof SepiaFilter# + * @memberof PIXI.filters.SepiaFilter# */ sepia: { get: function () diff --git a/src/filters/shockwave/ShockwaveFilter.js b/src/filters/shockwave/ShockwaveFilter.js index 8e1975d..3671e4b 100644 --- a/src/filters/shockwave/ShockwaveFilter.js +++ b/src/filters/shockwave/ShockwaveFilter.js @@ -37,7 +37,7 @@ * (0,0) is the top-left and (1,1) is the bottom right. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ center: { get: function () @@ -54,7 +54,7 @@ * the shockwave as it ripples out. * * @member {object} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ params: { get: function () @@ -71,7 +71,7 @@ * the shockwave ripples out. * * @member {number} - * @memberof ShockwaveFilter# + * @memberof PIXI.filters.ShockwaveFilter# */ time: { get: function () diff --git a/src/filters/tiltshift/TiltShiftAxisFilter.js b/src/filters/tiltshift/TiltShiftAxisFilter.js index 1f3883d..3bc3368 100644 --- a/src/filters/tiltshift/TiltShiftAxisFilter.js +++ b/src/filters/tiltshift/TiltShiftAxisFilter.js @@ -55,7 +55,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ blur: { get: function () @@ -72,7 +72,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftAxisFilter# + * @memberof PIXI.filters.TiltShiftAxisFilter# */ gradientBlur: { get: function () @@ -88,8 +88,8 @@ /** * The X value to start the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ start: { get: function () @@ -106,8 +106,8 @@ /** * The X value to end the effect at. * - * @member {Point} - * @memberof TiltShiftAxisFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TiltShiftAxisFilter# */ end: { get: function () diff --git a/src/filters/tiltshift/TiltShiftFilter.js b/src/filters/tiltshift/TiltShiftFilter.js index 8df0b06..26576d7 100644 --- a/src/filters/tiltshift/TiltShiftFilter.js +++ b/src/filters/tiltshift/TiltShiftFilter.js @@ -42,7 +42,7 @@ * The strength of the blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ blur: { get: function () @@ -59,7 +59,7 @@ * The strength of the gradient blur. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ gradientBlur: { get: function () @@ -76,7 +76,7 @@ * The Y value to start the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ start: { get: function () @@ -93,7 +93,7 @@ * The Y value to end the effect at. * * @member {number} - * @memberof TiltShiftFilter# + * @memberof PIXI.filters.TiltShiftFilter# */ end: { get: function () diff --git a/src/filters/twist/TwistFilter.js b/src/filters/twist/TwistFilter.js index acc1f82..4e95927 100644 --- a/src/filters/twist/TwistFilter.js +++ b/src/filters/twist/TwistFilter.js @@ -33,8 +33,8 @@ /** * This point describes the the offset of the twist. * - * @member {Point} - * @memberof TwistFilter# + * @member {PIXI.Point} + * @memberof PIXI.filters.TwistFilter# */ offset: { get: function () @@ -51,7 +51,7 @@ * This radius of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ radius: { get: function () @@ -68,7 +68,7 @@ * This angle of the twist. * * @member {number} - * @memberof TwistFilter# + * @memberof PIXI.filters.TwistFilter# */ angle: { get: function () diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index 6c3188c..9775971 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -11,14 +11,14 @@ /** * This point stores the global coords of where the touch/mouse event happened * - * @member {Point} + * @member {PIXI.Point} */ this.global = new core.Point(); /** * The target Sprite that was interacted with * - * @member {Sprite} + * @member {PIXI.Sprite} */ this.target = null; @@ -36,10 +36,10 @@ /** * This will return the local coordinates of the specified displayObject for this InteractionData * - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * param [globalPos] {Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject + * @param displayObject {PIXI.DisplayObject} The DisplayObject that you would like the local coords off + * @param [point] {PIXI.Point} A Point object in which to store the value, optional (otherwise will create a new point) + * param [globalPos] {PIXI.Point} A Point object containing your custom global coords, optional (otherwise will use the current global coords) + * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 15659fa..b7b607a 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -14,7 +14,7 @@ * * @class * @memberof PIXI.interaction - * @param renderer {CanvasRenderer|WebGLRenderer} A reference to the current renderer + * @param renderer {PIXI.CanvasRenderer|PIXI.WebGLRenderer} A reference to the current renderer * @param [options] {object} * @param [options.autoPreventDefault=true] {boolean} Should the manager automatically prevent default browser actions. * @param [options.interactionFrequency=10] {number} Frequency increases the interaction events will be checked. @@ -26,7 +26,7 @@ /** * The renderer this interaction manager works for. * - * @member {SystemRenderer} + * @member {PIXI.SystemRenderer} */ this.renderer = renderer; @@ -49,14 +49,14 @@ /** * The mouse data * - * @member {InteractionData} + * @member {PIXI.interaction.InteractionData} */ this.mouse = new InteractionData(); /** * An event data object to handle all the event tracking/dispatching * - * @member {EventData} + * @member {object} */ this.eventData = { stopped: false, @@ -71,7 +71,7 @@ /** * Tiny little interactiveData pool ! * - * @member {Array} + * @member {PIXI.interaction.InteractionData[]} */ this.interactiveDataPool = []; @@ -150,7 +150,7 @@ /** * Internal cached var - * @member {Point} + * @member {PIXI.Point} * @private */ this._tempPoint = new core.Point(); @@ -189,6 +189,7 @@ /** * Registers all the DOM events + * * @private */ InteractionManager.prototype.addEvents = function () @@ -221,6 +222,7 @@ /** * Removes all the DOM events that were previously registered + * * @private */ InteractionManager.prototype.removeEvents = function () @@ -298,9 +300,10 @@ /** * Dispatches an event on the display object that was interacted with - * @param displayObject {Container|Sprite|TilingSprite} the display object in question + * + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} the display object in question * @param eventString {string} the name of the event (e.g, mousedown) - * @param eventData {EventData} the event data object + * @param eventData {object} the event data object * @private */ InteractionManager.prototype.dispatchEvent = function ( displayObject, eventString, eventData ) @@ -323,7 +326,7 @@ * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The resulting value is stored in the point. * This takes into account the fact that the DOM element could be scaled and positioned anywhere on the screen. * - * @param {Point} point the point that the result will be stored in + * @param {PIXI.Point} point the point that the result will be stored in * @param {number} x the x coord of the position to map * @param {number} y the y coord of the position to map */ @@ -338,9 +341,9 @@ * This function is provides a neat way of crawling through the scene graph and running a specified function on all interactive objects it finds. * It will also take care of hit testing the interactive objects and passes the hit across in the function. * - * @param {Point} point the point that is tested for collision - * @param {Container|Sprite|TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) - * @param {function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function + * @param {PIXI.Point} point the point that is tested for collision + * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject the displayObject that will be hit test (recurcsivly crawls its children) + * @param {Function} func the function that will be called on each interactive object. The displayObject and hit will be passed to the function * @param {boolean} hitTest this indicates if the objects inside should be hit test against the point * @return {boolean} returns true if the displayObject hit the point */ @@ -430,7 +433,7 @@ /** * Processes the result of the mouse down check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the dispay object * @private */ @@ -470,7 +473,7 @@ /** * Processes the result of the mouse up check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -534,7 +537,7 @@ /** * Processes the result of the mouse move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -573,7 +576,7 @@ /** * Processes the result of the mouse over/out check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -639,7 +642,7 @@ /** * Processes the result of a touch check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -656,8 +659,8 @@ /** * Is called when a touch ends on the renderer element - * @param event {Event} The DOM event of a touch ending on the renderer view * + * @param event {Event} The DOM event of a touch ending on the renderer view */ InteractionManager.prototype.onTouchEnd = function (event) { @@ -691,7 +694,7 @@ /** * Processes the result of the end of a touch and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -753,7 +756,7 @@ /** * Processes the result of a touch move check and dispatches the event if need be * - * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param displayObject {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} The display object that was tested * @param hit {boolean} the result of the hit test on the display object * @private */ @@ -799,7 +802,7 @@ /** * Returns an interaction data object to the internal pool * - * @param touchData {InteractionData} The touch data object we want to return to the pool + * @param touchData {PIXI.interaction.InteractionData} The touch data object we want to return to the pool * * @private */ @@ -810,6 +813,7 @@ /** * Destroys the interaction manager + * */ InteractionManager.prototype.destroy = function () { this.removeEvents(); diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index 17b009b..14dc947 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -7,7 +7,7 @@ * @class * @extends PIXI.Container * @memberof PIXI.mesh - * @param texture {Texture} The texture to use + * @param texture {PIXI.Texture} The texture to use * @param [vertices] {Float32Arrif you want to specify the vertices * @param [uvs] {Float32Array} if you want to specify the uvs * @param [indices] {Uint16Array} if you want to specify the indices @@ -20,7 +20,7 @@ /** * The texture of the Mesh * - * @member {Texture} + * @member {PIXI.Texture} * @private */ this._texture = null; @@ -59,10 +59,11 @@ this.dirty = true; /** - * The blend mode to be applied to the sprite. Set to blendModes.NORMAL to remove any blend mode. + * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove any blend mode. * * @member {number} - * @default CONST.BLEND_MODES.NORMAL; + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES */ this.blendMode = core.BLEND_MODES.NORMAL; @@ -74,9 +75,10 @@ this.canvasPadding = 0; /** - * The way the Mesh should be drawn, can be any of the Mesh.DRAW_MODES consts + * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts * * @member {number} + * @see PIXI.mesh.Mesh.DRAW_MODES */ this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH; @@ -129,7 +131,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @param renderer {PIXI.WebGLRenderer} a reference to the WebGL renderer * @private */ Mesh.prototype._renderWebGL = function (renderer) @@ -141,7 +143,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {PIXI.CanvasRenderer} * @private */ Mesh.prototype._renderCanvas = function (renderer) @@ -304,7 +306,7 @@ /** * Renders a flat Mesh * - * @param Mesh {Mesh} The Mesh to render + * @param Mesh {PIXI.mesh.Mesh} The Mesh to render * @private */ Mesh.prototype.renderMeshFlat = function (Mesh) @@ -334,21 +336,6 @@ context.closePath(); }; -/* - Mesh.prototype.setTexture = function (texture) - { - //TODO SET THE TEXTURES - //TODO VISIBILITY - //TODO SETTER - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; - }; - */ - /** * When the texture is updated, this event will fire to update the scale and frame * @@ -363,8 +350,8 @@ /** * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. * - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle + * @param matrix {PIXI.Matrix} the transformation matrix of the sprite + * @return {PIXI.Rectangle} the framing rectangle */ Mesh.prototype.getBounds = function (matrix) { @@ -419,7 +406,7 @@ /** * Tests if a point is inside this mesh. Works only for TRIANGLE_MESH * - * @param point {Point} the point to test + * @param point {PIXI.Point} the point to test * @return {boolean} the result of the test */ Mesh.prototype.containsPoint = function( point ) { @@ -464,6 +451,7 @@ } return false; }; + /** * Different drawing buffer modes supported * diff --git a/src/mesh/Rope.js b/src/mesh/Rope.js index 842ae4b..c3fc687 100644 --- a/src/mesh/Rope.js +++ b/src/mesh/Rope.js @@ -12,10 +12,10 @@ * ``` * * @class - * @extends PIXI.Mesh + * @extends PIXI.mesh.Mesh * @memberof PIXI.mesh - * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point} objects to construct this rope. + * @param {PIXI.Texture} texture - The texture to use on the rope. + * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope. * */ function Rope(texture, points) @@ -23,7 +23,7 @@ Mesh.call(this, texture); /* - * @member {Array} An array of points that determine the rope + * @member {PIXI.Point[]} An array of points that determine the rope */ this.points = points; diff --git a/src/mesh/webgl/MeshRenderer.js b/src/mesh/webgl/MeshRenderer.js index a5a8e44..0be74df 100644 --- a/src/mesh/webgl/MeshRenderer.js +++ b/src/mesh/webgl/MeshRenderer.js @@ -18,7 +18,7 @@ * @private * @memberof PIXI.mesh * @extends PIXI.ObjectRenderer - * @param renderer {WebGLRenderer} The renderer this sprite batch works for. + * @param renderer {PIXI.WebGLRenderer} The renderer this sprite batch works for. */ function MeshRenderer(renderer) { @@ -64,7 +64,7 @@ /** * Renders the sprite object. * - * @param mesh {Mesh} the mesh to render + * @param mesh {PIXI.mesh.Mesh} the mesh to render */ MeshRenderer.prototype.render = function (mesh) { @@ -153,7 +153,7 @@ /** * Prepares all the buffers to render this mesh - * @param mesh {Mesh} the mesh to render + * @param mesh {PIXI.mesh.Mesh} the mesh to render */ MeshRenderer.prototype._initWebGL = function (mesh) { diff --git a/src/mesh/webgl/MeshShader.js b/src/mesh/webgl/MeshShader.js index 4b6c996..faa6eec 100644 --- a/src/mesh/webgl/MeshShader.js +++ b/src/mesh/webgl/MeshShader.js @@ -4,9 +4,9 @@ * @class * @extends PIXI.Shader * @memberof PIXI.mesh - * @param shaderManager {ShaderManager} The WebGL shader manager this shader works for. + * @param shaderManager {PIXI.ShaderManager} The WebGL shader manager this shader works for. */ -function StripShader(shaderManager) +function MeshShader(shaderManager) { core.Shader.call(this, shaderManager, @@ -52,8 +52,8 @@ ); } -StripShader.prototype = Object.create(core.Shader.prototype); -StripShader.prototype.constructor = StripShader; -module.exports = StripShader; +MeshShader.prototype = Object.create(core.Shader.prototype); +MeshShader.prototype.constructor = MeshShader; +module.exports = MeshShader; -core.ShaderManager.registerPlugin('meshShader', StripShader); +core.ShaderManager.registerPlugin('meshShader', MeshShader);