diff --git a/Gruntfile.js b/Gruntfile.js index b85df07..0853648 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,6 +26,7 @@ '<%= dirs.src %>/filters/FilterBlock.js', '<%= dirs.src %>/text/Text.js', '<%= dirs.src %>/text/BitmapText.js', + '<%= dirs.src %>/InteractionData.js', '<%= dirs.src %>/InteractionManager.js', '<%= dirs.src %>/display/Stage.js', '<%= dirs.src %>/utils/Utils.js', diff --git a/Gruntfile.js b/Gruntfile.js index b85df07..0853648 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,6 +26,7 @@ '<%= dirs.src %>/filters/FilterBlock.js', '<%= dirs.src %>/text/Text.js', '<%= dirs.src %>/text/BitmapText.js', + '<%= dirs.src %>/InteractionData.js', '<%= dirs.src %>/InteractionManager.js', '<%= dirs.src %>/display/Stage.js', '<%= dirs.src %>/utils/Utils.js', diff --git a/src/pixi/core/Matrix.js b/src/pixi/core/Matrix.js index 414cdec..b88735c 100644 --- a/src/pixi/core/Matrix.js +++ b/src/pixi/core/Matrix.js @@ -9,8 +9,8 @@ * */ PIXI.determineMatrixArrayType = function() { - return (typeof Float32Array !== 'undefined') ? Float32Array : Array; -} + return (typeof Float32Array !== 'undefined') ? Float32Array : Array; +}; PIXI.Matrix = PIXI.determineMatrixArrayType(); diff --git a/Gruntfile.js b/Gruntfile.js index b85df07..0853648 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,6 +26,7 @@ '<%= dirs.src %>/filters/FilterBlock.js', '<%= dirs.src %>/text/Text.js', '<%= dirs.src %>/text/BitmapText.js', + '<%= dirs.src %>/InteractionData.js', '<%= dirs.src %>/InteractionManager.js', '<%= dirs.src %>/display/Stage.js', '<%= dirs.src %>/utils/Utils.js', diff --git a/src/pixi/core/Matrix.js b/src/pixi/core/Matrix.js index 414cdec..b88735c 100644 --- a/src/pixi/core/Matrix.js +++ b/src/pixi/core/Matrix.js @@ -9,8 +9,8 @@ * */ PIXI.determineMatrixArrayType = function() { - return (typeof Float32Array !== 'undefined') ? Float32Array : Array; -} + return (typeof Float32Array !== 'undefined') ? Float32Array : Array; +}; PIXI.Matrix = PIXI.determineMatrixArrayType(); diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index 4203ab1..6f3c26e 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -10,8 +10,8 @@ * @constructor * @param width=800 {Number} the width of the canvas view * @param height=600 {Number} the height of the canvas view - * @param view {{HTMLCanvasElement}} the canvas to use as a view, optional - * @param transparent=false {Boolean} the transparency of the render view, default false + * @param [view] {HTMLCanvasElement} the canvas to use as a view, optional + * @param [transparent=false] {Boolean} the transparency of the render view, default false */ PIXI.CanvasRenderer = function(width, height, view, transparent) { @@ -97,7 +97,7 @@ * The canvas element that everything is drawn to * * @property view - * @type {HTMLCanvasElement} + * @type HTMLCanvasElement */ this.view = view || document.createElement( "canvas" ); @@ -123,6 +123,11 @@ */ this.maskManager = new PIXI.CanvasMaskManager(); + /** + * RenderSession TODO-Alvin + * @property renderSession + * @type Object + */ this.renderSession = { context: this.context, maskManager: this.maskManager, diff --git a/Gruntfile.js b/Gruntfile.js index b85df07..0853648 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,6 +26,7 @@ '<%= dirs.src %>/filters/FilterBlock.js', '<%= dirs.src %>/text/Text.js', '<%= dirs.src %>/text/BitmapText.js', + '<%= dirs.src %>/InteractionData.js', '<%= dirs.src %>/InteractionManager.js', '<%= dirs.src %>/display/Stage.js', '<%= dirs.src %>/utils/Utils.js', diff --git a/src/pixi/core/Matrix.js b/src/pixi/core/Matrix.js index 414cdec..b88735c 100644 --- a/src/pixi/core/Matrix.js +++ b/src/pixi/core/Matrix.js @@ -9,8 +9,8 @@ * */ PIXI.determineMatrixArrayType = function() { - return (typeof Float32Array !== 'undefined') ? Float32Array : Array; -} + return (typeof Float32Array !== 'undefined') ? Float32Array : Array; +}; PIXI.Matrix = PIXI.determineMatrixArrayType(); diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index 4203ab1..6f3c26e 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -10,8 +10,8 @@ * @constructor * @param width=800 {Number} the width of the canvas view * @param height=600 {Number} the height of the canvas view - * @param view {{HTMLCanvasElement}} the canvas to use as a view, optional - * @param transparent=false {Boolean} the transparency of the render view, default false + * @param [view] {HTMLCanvasElement} the canvas to use as a view, optional + * @param [transparent=false] {Boolean} the transparency of the render view, default false */ PIXI.CanvasRenderer = function(width, height, view, transparent) { @@ -97,7 +97,7 @@ * The canvas element that everything is drawn to * * @property view - * @type {HTMLCanvasElement} + * @type HTMLCanvasElement */ this.view = view || document.createElement( "canvas" ); @@ -123,6 +123,11 @@ */ this.maskManager = new PIXI.CanvasMaskManager(); + /** + * RenderSession TODO-Alvin + * @property renderSession + * @type Object + */ this.renderSession = { context: this.context, maskManager: this.maskManager, diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js index aaca78d..0839dc7 100644 --- a/src/pixi/renderers/webgl/WebGLRenderer.js +++ b/src/pixi/renderers/webgl/WebGLRenderer.js @@ -14,7 +14,7 @@ * @constructor * @param width=0 {Number} the width of the canvas view * @param height=0 {Number} the height of the canvas view - * @param view {Canvas} the canvas to use as a view, optional + * @param view {HTMLCanvasElement} the canvas to use as a view, optional * @param transparent=false {Boolean} If the render view is transparent, default false * @param antialias=false {Boolean} sets antialias (only applicable in chrome at the moment) * @@ -26,17 +26,44 @@ this.type = PIXI.WEBGL_RENDERER; // do a catch.. only 1 webGL renderer.. + /** + * Whether the render view is transparent + * + * @property transparent + * @type Boolean + */ this.transparent = !!transparent; + /** + * The width of the canvas view + * + * @property width + * @type Number + * @default 800 + */ this.width = width || 800; + + /** + * The height of the canvas view + * + * @property height + * @type Number + * @default 600 + */ this.height = height || 600; + /** + * The canvas element that everything is drawn to + * + * @property view + * @type HTMLCanvasElement + */ this.view = view || document.createElement( 'canvas' ); this.view.width = this.width; this.view.height = this.height; // deal with losing context.. - + // TODO-Alvin this.contextLost = this.handleContextLost.bind(this); this.contextRestoredLost = this.handleContextRestored.bind(this); // console.log(this.handleContextRestored) @@ -215,6 +242,14 @@ */ }; +/** + * Renders a display Object + * + * @method renderDIsplayObject + * @param displayObject {DisplayObject} The DisplayObject to render + * @param projection {Point} + * @param buffer {Array} buffer TODO-Alvin + */ PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) { // reset the render session data.. @@ -289,6 +324,13 @@ texture._glTextures.length = 0; }; +/** + * TODO-Alvin + * + * @method updateTextureFrame + * @param texture {Texture} The texture to update the frame from + * @private + */ PIXI.WebGLRenderer.updateTextureFrame = function(texture) { texture.updateFrame = false; @@ -319,6 +361,14 @@ this.projection.y = -this.height/2; }; +/** + * Creates a WebGL texture + * + * @method createWebGLTexture + * @param texture {Texture} the texture to render + * @param gl {webglContext} the WebGL context + * @static + */ PIXI.createWebGLTexture = function(texture, gl) { @@ -353,6 +403,14 @@ return texture._glTextures[gl.id]; }; +/** + * Updates a WebGL texture + * + * @method updateWebGLTexture + * @param texture {Texture} the texture to update + * @param gl {webglContext} the WebGL context + * @private + */ PIXI.updateWebGLTexture = function(texture, gl) { if( texture._glTextures[gl.id] ) @@ -446,10 +504,20 @@ texture._glTextures = []; } + /** + * Whether the context was lost + * @property contextLost + * @type Boolean + */ this.contextLost = false; }; +/** + * Destroy TODO-Alvin + * + * @method destroy + */ PIXI.WebGLRenderer.prototype.destroy = function() {