diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 740637b..83bc702 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -87,7 +87,7 @@ /** * The WebGL UV data cache. * - * @member {object} + * @member {TextureUvs} * @private */ this._uvs = null; diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 740637b..83bc702 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -87,7 +87,7 @@ /** * The WebGL UV data cache. * - * @member {object} + * @member {TextureUvs} * @private */ this._uvs = null; diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 5e93f00..b567a29 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -92,6 +92,13 @@ } }, + /** + * The array of textures used for this MovieClip + * + * @member + * @memberof MovieClip# + * + */ textures: { get: function () { diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 740637b..83bc702 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -87,7 +87,7 @@ /** * The WebGL UV data cache. * - * @member {object} + * @member {TextureUvs} * @private */ this._uvs = null; diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 5e93f00..b567a29 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -92,6 +92,13 @@ } }, + /** + * The array of textures used for this MovieClip + * + * @member + * @memberof MovieClip# + * + */ textures: { get: function () { diff --git a/src/extras/Rope.js b/src/extras/Rope.js index 47c8f48..8b85d60 100644 --- a/src/extras/Rope.js +++ b/src/extras/Rope.js @@ -6,17 +6,36 @@ * @namespace PIXI * @extends Strip * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point}. + * @param {Array} points - An array of {Point} objects. * */ function Rope(texture, points) { Strip.call(this, texture); + + /* + * @member {Array} An array of points that determine the rope + */ this.points = points; + /* + * @member {Float32Array} An array of vertices used to construct this rope. + */ this.vertices = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} The WebGL Uvs of the rope. + */ this.uvs = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} An array containing the color components + */ this.colors = new Float32Array(points.length * 2); + + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array(points.length * 2); this.refresh(); diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 740637b..83bc702 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -87,7 +87,7 @@ /** * The WebGL UV data cache. * - * @member {object} + * @member {TextureUvs} * @private */ this._uvs = null; diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 5e93f00..b567a29 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -92,6 +92,13 @@ } }, + /** + * The array of textures used for this MovieClip + * + * @member + * @memberof MovieClip# + * + */ textures: { get: function () { diff --git a/src/extras/Rope.js b/src/extras/Rope.js index 47c8f48..8b85d60 100644 --- a/src/extras/Rope.js +++ b/src/extras/Rope.js @@ -6,17 +6,36 @@ * @namespace PIXI * @extends Strip * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point}. + * @param {Array} points - An array of {Point} objects. * */ function Rope(texture, points) { Strip.call(this, texture); + + /* + * @member {Array} An array of points that determine the rope + */ this.points = points; + /* + * @member {Float32Array} An array of vertices used to construct this rope. + */ this.vertices = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} The WebGL Uvs of the rope. + */ this.uvs = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} An array containing the color components + */ this.colors = new Float32Array(points.length * 2); + + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array(points.length * 2); this.refresh(); diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 345a10d..519821f 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -48,6 +48,9 @@ */ this.colors = new Float32Array([1, 1, 1, 1]); + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array([0, 1, 2, 3]); /** @@ -72,6 +75,11 @@ */ this.canvasPadding = 0; + /** + * The way the strip should be drawn, can be any of the Strip.DrawModes consts + * + * @member {number} + */ this.drawMode = Strip.DrawModes.TRIANGLE_STRIP; } @@ -83,7 +91,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {WebGLRenderer} a reference to the WebGL renderer */ Strip.prototype.renderWebGL = function (renderer) { @@ -114,6 +122,12 @@ //TODO check culling }; +/** + * Creates the buffers and (in the darkness) binds them + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._initWebGL = function (renderer) { // build the strip! @@ -137,6 +151,12 @@ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); }; +/** + * Renders the strip ! + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._renderStrip = function (renderer) { var gl = renderer.gl; @@ -260,6 +280,12 @@ } }; +/** + * Draws the object in TRIANGLE_STRIP mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangleStrip = function (context) { // draw triangles!! @@ -277,6 +303,12 @@ } }; +/** + * Draws the object in triangle mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangles = function (context) { // draw triangles!! @@ -295,6 +327,17 @@ } }; +/** + * Draws one of the triangles that form this strip + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @param vertices {Float32Array} a reference to the the vertices of the strip + * @param uvs {Float32Array} a reference to the the vertices of the strip + * @param index0 {number} the index of the first vertex + * @param index1 {number} the index of the second vertex + * @param index2 {number} the index of the third vertex + * @private + */ Strip.prototype._renderCanvasDrawTriangle = function (context, vertices, uvs, index0, index1, index2) { var textureSource = this.texture.baseTexture.source; diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 740637b..83bc702 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -87,7 +87,7 @@ /** * The WebGL UV data cache. * - * @member {object} + * @member {TextureUvs} * @private */ this._uvs = null; diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 5e93f00..b567a29 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -92,6 +92,13 @@ } }, + /** + * The array of textures used for this MovieClip + * + * @member + * @memberof MovieClip# + * + */ textures: { get: function () { diff --git a/src/extras/Rope.js b/src/extras/Rope.js index 47c8f48..8b85d60 100644 --- a/src/extras/Rope.js +++ b/src/extras/Rope.js @@ -6,17 +6,36 @@ * @namespace PIXI * @extends Strip * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point}. + * @param {Array} points - An array of {Point} objects. * */ function Rope(texture, points) { Strip.call(this, texture); + + /* + * @member {Array} An array of points that determine the rope + */ this.points = points; + /* + * @member {Float32Array} An array of vertices used to construct this rope. + */ this.vertices = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} The WebGL Uvs of the rope. + */ this.uvs = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} An array containing the color components + */ this.colors = new Float32Array(points.length * 2); + + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array(points.length * 2); this.refresh(); diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 345a10d..519821f 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -48,6 +48,9 @@ */ this.colors = new Float32Array([1, 1, 1, 1]); + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array([0, 1, 2, 3]); /** @@ -72,6 +75,11 @@ */ this.canvasPadding = 0; + /** + * The way the strip should be drawn, can be any of the Strip.DrawModes consts + * + * @member {number} + */ this.drawMode = Strip.DrawModes.TRIANGLE_STRIP; } @@ -83,7 +91,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {WebGLRenderer} a reference to the WebGL renderer */ Strip.prototype.renderWebGL = function (renderer) { @@ -114,6 +122,12 @@ //TODO check culling }; +/** + * Creates the buffers and (in the darkness) binds them + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._initWebGL = function (renderer) { // build the strip! @@ -137,6 +151,12 @@ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); }; +/** + * Renders the strip ! + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._renderStrip = function (renderer) { var gl = renderer.gl; @@ -260,6 +280,12 @@ } }; +/** + * Draws the object in TRIANGLE_STRIP mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangleStrip = function (context) { // draw triangles!! @@ -277,6 +303,12 @@ } }; +/** + * Draws the object in triangle mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangles = function (context) { // draw triangles!! @@ -295,6 +327,17 @@ } }; +/** + * Draws one of the triangles that form this strip + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @param vertices {Float32Array} a reference to the the vertices of the strip + * @param uvs {Float32Array} a reference to the the vertices of the strip + * @param index0 {number} the index of the first vertex + * @param index1 {number} the index of the second vertex + * @param index2 {number} the index of the third vertex + * @private + */ Strip.prototype._renderCanvasDrawTriangle = function (context, vertices, uvs, index0, index1, index2) { var textureSource = this.texture.baseTexture.source; diff --git a/src/extras/StripShader.js b/src/extras/StripShader.js index bb12757..acbe147 100644 --- a/src/extras/StripShader.js +++ b/src/extras/StripShader.js @@ -3,7 +3,8 @@ /** * @class * @namespace PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {ShaderManager} The WebGL shader manager this shader works for. + * @extends Shader */ function StripShader(shaderManager) { diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 740637b..83bc702 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -87,7 +87,7 @@ /** * The WebGL UV data cache. * - * @member {object} + * @member {TextureUvs} * @private */ this._uvs = null; diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 5e93f00..b567a29 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -92,6 +92,13 @@ } }, + /** + * The array of textures used for this MovieClip + * + * @member + * @memberof MovieClip# + * + */ textures: { get: function () { diff --git a/src/extras/Rope.js b/src/extras/Rope.js index 47c8f48..8b85d60 100644 --- a/src/extras/Rope.js +++ b/src/extras/Rope.js @@ -6,17 +6,36 @@ * @namespace PIXI * @extends Strip * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point}. + * @param {Array} points - An array of {Point} objects. * */ function Rope(texture, points) { Strip.call(this, texture); + + /* + * @member {Array} An array of points that determine the rope + */ this.points = points; + /* + * @member {Float32Array} An array of vertices used to construct this rope. + */ this.vertices = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} The WebGL Uvs of the rope. + */ this.uvs = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} An array containing the color components + */ this.colors = new Float32Array(points.length * 2); + + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array(points.length * 2); this.refresh(); diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 345a10d..519821f 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -48,6 +48,9 @@ */ this.colors = new Float32Array([1, 1, 1, 1]); + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array([0, 1, 2, 3]); /** @@ -72,6 +75,11 @@ */ this.canvasPadding = 0; + /** + * The way the strip should be drawn, can be any of the Strip.DrawModes consts + * + * @member {number} + */ this.drawMode = Strip.DrawModes.TRIANGLE_STRIP; } @@ -83,7 +91,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {WebGLRenderer} a reference to the WebGL renderer */ Strip.prototype.renderWebGL = function (renderer) { @@ -114,6 +122,12 @@ //TODO check culling }; +/** + * Creates the buffers and (in the darkness) binds them + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._initWebGL = function (renderer) { // build the strip! @@ -137,6 +151,12 @@ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); }; +/** + * Renders the strip ! + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._renderStrip = function (renderer) { var gl = renderer.gl; @@ -260,6 +280,12 @@ } }; +/** + * Draws the object in TRIANGLE_STRIP mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangleStrip = function (context) { // draw triangles!! @@ -277,6 +303,12 @@ } }; +/** + * Draws the object in triangle mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangles = function (context) { // draw triangles!! @@ -295,6 +327,17 @@ } }; +/** + * Draws one of the triangles that form this strip + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @param vertices {Float32Array} a reference to the the vertices of the strip + * @param uvs {Float32Array} a reference to the the vertices of the strip + * @param index0 {number} the index of the first vertex + * @param index1 {number} the index of the second vertex + * @param index2 {number} the index of the third vertex + * @private + */ Strip.prototype._renderCanvasDrawTriangle = function (context, vertices, uvs, index0, index1, index2) { var textureSource = this.texture.baseTexture.source; diff --git a/src/extras/StripShader.js b/src/extras/StripShader.js index bb12757..acbe147 100644 --- a/src/extras/StripShader.js +++ b/src/extras/StripShader.js @@ -3,7 +3,8 @@ /** * @class * @namespace PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {ShaderManager} The WebGL shader manager this shader works for. + * @extends Shader */ function StripShader(shaderManager) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 18955c0..bbd1f56 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,8 +19,6 @@ { core.Sprite.call(this, texture); - - /** * The scaling of the image that is being tiled * @@ -36,14 +34,13 @@ */ this.tilePosition = new core.math.Point(0,0); - - ///// private /** * The with of the tiling sprite * * @member {number} + * @private */ this._width = width || 100; @@ -51,6 +48,7 @@ * The height of the tiling sprite * * @member {number} + * @private */ this._height = height || 100; @@ -58,13 +56,33 @@ * A point that represents the scale of the texture object * * @member {Point} + * @private */ this._tileScaleOffset = new core.math.Point(1,1); + /** + * + * + * @member {boolean} + * @private + */ this._tilingTexture = null; + + /** + * + * + * @member {boolean} + * @private + */ this._refreshTexture = false; + /** + * An internal WebGL UV cache. + * + * @member {TextureUvs} + * @private + */ this._uvs = new TextureUvs(); } @@ -187,7 +205,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {CanvasRenderer} a reference to the canvas renderer */ TilingSprite.prototype.renderCanvas = function (renderer) { @@ -359,7 +377,9 @@ }; /** - * + * Creates the tiling texture + * @param renderer {CanvasRenderer|WebGLRenderer} a reference to the current renderer + * @param texture {Texture} The texture to use to generate the tiling texture * @param forcePowerOfTwo {boolean} Whether we want to force the texture to be a power of two */ TilingSprite.prototype.generateTilingTexture = function (renderer, texture, forcePowerOfTwo) @@ -421,6 +441,10 @@ }; +/** + * Checks if a point is inside this tiling sprite + * @param point {Point} the point to check + */ TilingSprite.prototype.hitTest = function( point ) { this.worldTransform.applyInverse(point, tempPoint); @@ -443,7 +467,10 @@ return false; }; - +/** + * Destroys this tiling sprite + * + */ TilingSprite.prototype.destroy = function () { core.Sprite.prototype.destroy.call(this); diff --git a/src/core/graphics/webgl/WebGLGraphicsData.js b/src/core/graphics/webgl/WebGLGraphicsData.js index 71a52c8..45132d8 100644 --- a/src/core/graphics/webgl/WebGLGraphicsData.js +++ b/src/core/graphics/webgl/WebGLGraphicsData.js @@ -14,26 +14,26 @@ //TODO does this need to be split before uploding?? /* - * @member {Array} an array of color components (r,g,b) + * @member {Array} An array of color components (r,g,b) */ this.color = [0,0,0]; // color split! /* - * @member {Array} an array of points to draw + * @member {Array} An array of points to draw */ this.points = []; /* - * @member {Array} the indices of the vertices + * @member {Array} The indices of the vertices */ this.indices = []; /* - * @member {WebGLBuffer} the main buffer + * @member {WebGLBuffer} The main buffer */ this.buffer = gl.createBuffer(); /* - * @member {WebGLBuffer} the index buffer + * @member {WebGLBuffer} The index buffer */ this.indexBuffer = gl.createBuffer(); diff --git a/src/core/renderers/canvas/utils/CanvasGraphics.js b/src/core/renderers/canvas/utils/CanvasGraphics.js index 3f2a91f..f0bccfd 100644 --- a/src/core/renderers/canvas/utils/CanvasGraphics.js +++ b/src/core/renderers/canvas/utils/CanvasGraphics.js @@ -2,7 +2,7 @@ /** * A set of functions used by the canvas renderer to draw the primitive graphics data. - * + * @static * @namespace PIXI */ var CanvasGraphics = module.exports = {}; @@ -293,6 +293,13 @@ } }; +/* + * Updates the tint of a graphics object + * + * @private + * @param graphics {Graphics} the graphics that will have its tint updated + * + */ CanvasGraphics.updateGraphicsTint = function (graphics) { if (graphics.tint === 0xFFFFFF) diff --git a/src/core/renderers/canvas/utils/CanvasTinter.js b/src/core/renderers/canvas/utils/CanvasTinter.js index d2fb1bc..272c7c2 100644 --- a/src/core/renderers/canvas/utils/CanvasTinter.js +++ b/src/core/renderers/canvas/utils/CanvasTinter.js @@ -2,7 +2,7 @@ /** * Utility methods for Sprite/Texture tinting. - * + * @static * @namespace PIXI */ var CanvasTinter = module.exports = {}; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ccbb887..9e56169 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -114,9 +114,16 @@ */ this.blendModeManager = new BlendModeManager(this); + /** + * Holds the current render target + * @member {Object} + */ this.currentRenderTarget = this.renderTarget; - + /** + * + * @member {ObjectRenderer} @alvin + */ this.currentRenderer = new ObjectRenderer(this); this.initPlugins(); @@ -127,6 +134,10 @@ // map some webGL blend modes.. this._mapBlendModes(); + /** + * An array of render targets + * @member {Array} TODO @alvin + */ this._renderTargetStack = []; } @@ -253,6 +264,12 @@ this.currentRenderer.flush(); }; +/** + * Changes the current renderer to the one given in parameter + * + * @param objectRenderer {Object} TODO @alvin + * + */ WebGLRenderer.prototype.setObjectRenderer = function (objectRenderer) { if (this.currentRenderer === objectRenderer) @@ -265,6 +282,12 @@ this.currentRenderer.start(); }; +/** + * Changes the current render target to the one given in parameter + * + * @param renderTarget {Object} the new render target + * + */ WebGLRenderer.prototype.setRenderTarget = function (renderTarget) { // TODO - maybe down the line this should be a push pos thing? Leaving for now though. @@ -345,6 +368,11 @@ return texture._glTextures[gl.id]; }; +/** + * Deletes the texture from WebGL + * + * @param texture {BaseTexture|Texture} the texture to destroy + */ WebGLRenderer.prototype.destroyTexture = function (texture) { texture = texture.baseTexture || texture; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 740637b..83bc702 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -87,7 +87,7 @@ /** * The WebGL UV data cache. * - * @member {object} + * @member {TextureUvs} * @private */ this._uvs = null; diff --git a/src/extras/MovieClip.js b/src/extras/MovieClip.js index 5e93f00..b567a29 100644 --- a/src/extras/MovieClip.js +++ b/src/extras/MovieClip.js @@ -92,6 +92,13 @@ } }, + /** + * The array of textures used for this MovieClip + * + * @member + * @memberof MovieClip# + * + */ textures: { get: function () { diff --git a/src/extras/Rope.js b/src/extras/Rope.js index 47c8f48..8b85d60 100644 --- a/src/extras/Rope.js +++ b/src/extras/Rope.js @@ -6,17 +6,36 @@ * @namespace PIXI * @extends Strip * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {Point}. + * @param {Array} points - An array of {Point} objects. * */ function Rope(texture, points) { Strip.call(this, texture); + + /* + * @member {Array} An array of points that determine the rope + */ this.points = points; + /* + * @member {Float32Array} An array of vertices used to construct this rope. + */ this.vertices = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} The WebGL Uvs of the rope. + */ this.uvs = new Float32Array(points.length * 4); + + /* + * @member {Float32Array} An array containing the color components + */ this.colors = new Float32Array(points.length * 2); + + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array(points.length * 2); this.refresh(); diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 345a10d..519821f 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -48,6 +48,9 @@ */ this.colors = new Float32Array([1, 1, 1, 1]); + /* + * @member {Uint16Array} An array containing the indices of the vertices + */ this.indices = new Uint16Array([0, 1, 2, 3]); /** @@ -72,6 +75,11 @@ */ this.canvasPadding = 0; + /** + * The way the strip should be drawn, can be any of the Strip.DrawModes consts + * + * @member {number} + */ this.drawMode = Strip.DrawModes.TRIANGLE_STRIP; } @@ -83,7 +91,7 @@ /** * Renders the object using the WebGL renderer * - * @param renderer {WebGLRenderer} + * @param renderer {WebGLRenderer} a reference to the WebGL renderer */ Strip.prototype.renderWebGL = function (renderer) { @@ -114,6 +122,12 @@ //TODO check culling }; +/** + * Creates the buffers and (in the darkness) binds them + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._initWebGL = function (renderer) { // build the strip! @@ -137,6 +151,12 @@ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); }; +/** + * Renders the strip ! + * + * @param renderer {WebGLRenderer} a reference to the WebGL renderer + * @private + */ Strip.prototype._renderStrip = function (renderer) { var gl = renderer.gl; @@ -260,6 +280,12 @@ } }; +/** + * Draws the object in TRIANGLE_STRIP mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangleStrip = function (context) { // draw triangles!! @@ -277,6 +303,12 @@ } }; +/** + * Draws the object in triangle mode using canvas + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @private + */ Strip.prototype._renderCanvasTriangles = function (context) { // draw triangles!! @@ -295,6 +327,17 @@ } }; +/** + * Draws one of the triangles that form this strip + * + * @param context {CanvasRenderingContext2D} the current drawing context + * @param vertices {Float32Array} a reference to the the vertices of the strip + * @param uvs {Float32Array} a reference to the the vertices of the strip + * @param index0 {number} the index of the first vertex + * @param index1 {number} the index of the second vertex + * @param index2 {number} the index of the third vertex + * @private + */ Strip.prototype._renderCanvasDrawTriangle = function (context, vertices, uvs, index0, index1, index2) { var textureSource = this.texture.baseTexture.source; diff --git a/src/extras/StripShader.js b/src/extras/StripShader.js index bb12757..acbe147 100644 --- a/src/extras/StripShader.js +++ b/src/extras/StripShader.js @@ -3,7 +3,8 @@ /** * @class * @namespace PIXI - * @param shaderManager {ShaderManager} The webgl shader manager this shader works for. + * @param shaderManager {ShaderManager} The WebGL shader manager this shader works for. + * @extends Shader */ function StripShader(shaderManager) { diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 18955c0..bbd1f56 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -19,8 +19,6 @@ { core.Sprite.call(this, texture); - - /** * The scaling of the image that is being tiled * @@ -36,14 +34,13 @@ */ this.tilePosition = new core.math.Point(0,0); - - ///// private /** * The with of the tiling sprite * * @member {number} + * @private */ this._width = width || 100; @@ -51,6 +48,7 @@ * The height of the tiling sprite * * @member {number} + * @private */ this._height = height || 100; @@ -58,13 +56,33 @@ * A point that represents the scale of the texture object * * @member {Point} + * @private */ this._tileScaleOffset = new core.math.Point(1,1); + /** + * + * + * @member {boolean} + * @private + */ this._tilingTexture = null; + + /** + * + * + * @member {boolean} + * @private + */ this._refreshTexture = false; + /** + * An internal WebGL UV cache. + * + * @member {TextureUvs} + * @private + */ this._uvs = new TextureUvs(); } @@ -187,7 +205,7 @@ /** * Renders the object using the Canvas renderer * - * @param renderer {CanvasRenderer} + * @param renderer {CanvasRenderer} a reference to the canvas renderer */ TilingSprite.prototype.renderCanvas = function (renderer) { @@ -359,7 +377,9 @@ }; /** - * + * Creates the tiling texture + * @param renderer {CanvasRenderer|WebGLRenderer} a reference to the current renderer + * @param texture {Texture} The texture to use to generate the tiling texture * @param forcePowerOfTwo {boolean} Whether we want to force the texture to be a power of two */ TilingSprite.prototype.generateTilingTexture = function (renderer, texture, forcePowerOfTwo) @@ -421,6 +441,10 @@ }; +/** + * Checks if a point is inside this tiling sprite + * @param point {Point} the point to check + */ TilingSprite.prototype.hitTest = function( point ) { this.worldTransform.applyInverse(point, tempPoint); @@ -443,7 +467,10 @@ return false; }; - +/** + * Destroys this tiling sprite + * + */ TilingSprite.prototype.destroy = function () { core.Sprite.prototype.destroy.call(this); diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 1270b14..ad7001a 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -13,7 +13,7 @@ * * @class * @namespace PIXI - * @param stage {Stage} The stage to handle interactions + * @param renderer {CanvasRenderer|WebGLRenderer} A reference to the current renderer */ function InteractionManager( renderer ) { @@ -26,6 +26,11 @@ */ this.mouse = new InteractionData(); + /** + * An event data object to handle all the event tracking/dispatching + * + * @member {EventData} + */ this.eventData = new core.utils.EventData(); this.eventData.data = this.mouse; @@ -109,9 +114,15 @@ */ this.currentCursorStyle = 'inherit'; + /** + * Internal cached var + * @member {Point} + * @private + */ this._tempPoint = new core.math.Point(); /** + * The current resolution * @member {number} */ this.resolution = 1; @@ -145,7 +156,7 @@ }; /** - * + * Registers all the DOM events * @private */ InteractionManager.prototype.addEvents = function () @@ -175,7 +186,7 @@ }; /** - * + * Removes all the DOM events that were previously registered * @private */ InteractionManager.prototype.removeEvents = function () @@ -240,7 +251,13 @@ //TODO }; - +/** + * Dispatches an event on the display object that was interacted with + * @param displayObject {Container|Sprite|TilingSprite} the display object in question + * @param eventString {string} the name of the event (e.g, mousedown) + * @param eventData {EventData} the event data object + * @private + */ InteractionManager.prototype.dispatchEvent = function ( displayObject, eventString, eventData ) { if(!eventData.stopped) @@ -257,6 +274,10 @@ } }; +/** + * Ensures the interaction checks don't happen too often by delaying the update loop + * @private + */ InteractionManager.prototype.throttleUpdate = function () { // frequency of 30fps?? @@ -275,10 +296,11 @@ /** * 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 position anywhere on the screen. - * @param {[type]} point The point that the result will be stored in - * @param {[type]} x the x coord of the position to map - * @param {[type]} y the y coord of the position to map + * 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 {number} x the x coord of the position to map + * @param {number} y the y coord of the position to map */ InteractionManager.prototype.mapPositionToPoint = function ( point, x, y ) { @@ -290,8 +312,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 {DisplayObject} displayObject the displayObject that will be hit test (recurcsivly crawls its children) + * @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 {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 @@ -376,6 +399,13 @@ this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseDown, true ); }; +/** + * 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 hit {boolean} the result of the hit test on the dispay object + * @private + */ InteractionManager.prototype.processMouseDown = function ( displayObject, hit ) { var e = this.mouse.originalEvent; @@ -406,6 +436,13 @@ this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseUp, true ); }; +/** + * 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 hit {boolean} the result of the hit test on the display object + * @private + */ InteractionManager.prototype.processMouseUp = function ( displayObject, hit ) { var e = this.mouse.originalEvent; @@ -434,8 +471,6 @@ }; - - /** * Is called when the mouse moves across the renderer element * @@ -465,6 +500,13 @@ //TODO BUG for parents ineractive object (border order issue) }; +/** + * 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 hit {boolean} the result of the hit test on the display object + * @private + */ InteractionManager.prototype.processMouseMove = function ( displayObject, hit ) { this.dispatchEvent( displayObject, 'mousemove', this.eventData); @@ -491,6 +533,13 @@ this.processInteractive( this.mouse.global, this.renderer._lastObjectRendered, this.processMouseOverOut, false ); }; +/** + * 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 hit {boolean} the result of the hit test on the display object + * @private + */ InteractionManager.prototype.processMouseOverOut = function ( displayObject, hit ) { if(hit) @@ -549,11 +598,11 @@ } }; - /** - * Is called when a touch is ended on the renderer element + * Processes the result of a touch check and dispatches the event if need be * - * @param event {Event} The DOM event of a touch ending on the renderer view + * @param displayObject {Container|Sprite|TilingSprite} The display object that was tested + * @param hit {boolean} the result of the hit test on the display object * @private */ InteractionManager.prototype.processTouchStart = function ( displayObject, hit ) @@ -570,7 +619,7 @@ /** * [onTouchEnd description] * @param {[type]} event [description] - * @return {[type]} [description] + * */ InteractionManager.prototype.onTouchEnd = function (event) { @@ -600,6 +649,13 @@ } }; +/** + * 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 hit {boolean} the result of the hit test on the display object + * @private + */ InteractionManager.prototype.processTouchEnd = function ( displayObject, hit ) { if(hit) @@ -654,14 +710,26 @@ } }; - +/** + * 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 hit {boolean} the result of the hit test on the display object + * @private + */ InteractionManager.prototype.processTouchMove = function ( displayObject, hit ) { hit = hit; this.dispatchEvent( displayObject, 'touchmove', this.eventData); }; - +/** + * Grabs an interaction data object from the internal pool + * + * @param touchEvent {} The touch event we need to pair with a touchData object + * + * @private + */ InteractionManager.prototype.getTouchData = function (touchEvent) { var touchData = this.interactiveDataPool.pop(); @@ -677,6 +745,13 @@ return touchData; }; +/** + * Returns an interaction data object to the internal pool + * + * @param touchEvent {InteractionData} The touch data object we want to return to the pool + * + * @private + */ InteractionManager.prototype.returnTouchData = function ( touchData ) { this.interactiveDataPool.push( touchData );