diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index ea66c5b..7a3c7b1 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -16,7 +16,7 @@ PIXI.CANVAS_RENDERER = 1; // useful for testing against if your lib is using pixi. -PIXI.VERSION = "v1.4.4"; +PIXI.VERSION = "v1.5.0"; // the various blend modes supported by pixi PIXI.blendModes = { diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index ea66c5b..7a3c7b1 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -16,7 +16,7 @@ PIXI.CANVAS_RENDERER = 1; // useful for testing against if your lib is using pixi. -PIXI.VERSION = "v1.4.4"; +PIXI.VERSION = "v1.5.0"; // the various blend modes supported by pixi PIXI.blendModes = { diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index c5dc209..d40cd56 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -466,8 +466,8 @@ * @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 */ -PIXI.Sprite.fromImage = function(imageId) +PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode) { - var texture = PIXI.Texture.fromImage(imageId); + var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode); return new PIXI.Sprite(texture); }; diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index ea66c5b..7a3c7b1 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -16,7 +16,7 @@ PIXI.CANVAS_RENDERER = 1; // useful for testing against if your lib is using pixi. -PIXI.VERSION = "v1.4.4"; +PIXI.VERSION = "v1.5.0"; // the various blend modes supported by pixi PIXI.blendModes = { diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index c5dc209..d40cd56 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -466,8 +466,8 @@ * @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 */ -PIXI.Sprite.fromImage = function(imageId) +PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode) { - var texture = PIXI.Texture.fromImage(imageId); + var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode); return new PIXI.Sprite(texture); }; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 7810640..35105d7 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -169,6 +169,8 @@ fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY}; this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -188,6 +190,8 @@ this.currentPath.points.push(x, y); this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -202,6 +206,8 @@ { this.currentPath.points.push(x, y); this.dirty = true; + + return this; }; /** @@ -218,6 +224,8 @@ this.filling = true; this.fillColor = color || 0; this.fillAlpha = (arguments.length < 2) ? 1 : alpha; + + return this; }; /** @@ -230,6 +238,8 @@ this.filling = false; this.fillColor = null; this.fillAlpha = 1; + + return this; }; /** @@ -250,6 +260,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -271,6 +283,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -293,6 +307,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -310,6 +326,8 @@ this.graphicsData = []; this.bounds = null; //new PIXI.Rectangle(); + + return this; }; /** diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index ea66c5b..7a3c7b1 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -16,7 +16,7 @@ PIXI.CANVAS_RENDERER = 1; // useful for testing against if your lib is using pixi. -PIXI.VERSION = "v1.4.4"; +PIXI.VERSION = "v1.5.0"; // the various blend modes supported by pixi PIXI.blendModes = { diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index c5dc209..d40cd56 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -466,8 +466,8 @@ * @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 */ -PIXI.Sprite.fromImage = function(imageId) +PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode) { - var texture = PIXI.Texture.fromImage(imageId); + var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode); return new PIXI.Sprite(texture); }; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 7810640..35105d7 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -169,6 +169,8 @@ fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY}; this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -188,6 +190,8 @@ this.currentPath.points.push(x, y); this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -202,6 +206,8 @@ { this.currentPath.points.push(x, y); this.dirty = true; + + return this; }; /** @@ -218,6 +224,8 @@ this.filling = true; this.fillColor = color || 0; this.fillAlpha = (arguments.length < 2) ? 1 : alpha; + + return this; }; /** @@ -230,6 +238,8 @@ this.filling = false; this.fillColor = null; this.fillAlpha = 1; + + return this; }; /** @@ -250,6 +260,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -271,6 +283,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -293,6 +307,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -310,6 +326,8 @@ this.graphicsData = []; this.bounds = null; //new PIXI.Rectangle(); + + return this; }; /** diff --git a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js index 60de6b4..0a63b34 100644 --- a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js @@ -273,7 +273,7 @@ // set the textures uvs temporarily // TODO create a separate texture so that we can tile part of a texture - if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8); + if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); var uvs = tilingSprite._uvs; @@ -298,7 +298,6 @@ uvs.x3 = 0 - offsetX; uvs.y3 = (1 *scaleY) - offsetY; - // get the tilingSprites current alpha var alpha = tilingSprite.worldAlpha; var tint = tilingSprite.tint; diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index ea66c5b..7a3c7b1 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -16,7 +16,7 @@ PIXI.CANVAS_RENDERER = 1; // useful for testing against if your lib is using pixi. -PIXI.VERSION = "v1.4.4"; +PIXI.VERSION = "v1.5.0"; // the various blend modes supported by pixi PIXI.blendModes = { diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index c5dc209..d40cd56 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -466,8 +466,8 @@ * @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 */ -PIXI.Sprite.fromImage = function(imageId) +PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode) { - var texture = PIXI.Texture.fromImage(imageId); + var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode); return new PIXI.Sprite(texture); }; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 7810640..35105d7 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -169,6 +169,8 @@ fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY}; this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -188,6 +190,8 @@ this.currentPath.points.push(x, y); this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -202,6 +206,8 @@ { this.currentPath.points.push(x, y); this.dirty = true; + + return this; }; /** @@ -218,6 +224,8 @@ this.filling = true; this.fillColor = color || 0; this.fillAlpha = (arguments.length < 2) ? 1 : alpha; + + return this; }; /** @@ -230,6 +238,8 @@ this.filling = false; this.fillColor = null; this.fillAlpha = 1; + + return this; }; /** @@ -250,6 +260,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -271,6 +283,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -293,6 +307,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -310,6 +326,8 @@ this.graphicsData = []; this.bounds = null; //new PIXI.Rectangle(); + + return this; }; /** diff --git a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js index 60de6b4..0a63b34 100644 --- a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js @@ -273,7 +273,7 @@ // set the textures uvs temporarily // TODO create a separate texture so that we can tile part of a texture - if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8); + if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); var uvs = tilingSprite._uvs; @@ -298,7 +298,6 @@ uvs.x3 = 0 - offsetX; uvs.y3 = (1 *scaleY) - offsetY; - // get the tilingSprites current alpha var alpha = tilingSprite.worldAlpha; var tint = tilingSprite.tint; diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index 3d4b2c3..dea205a 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -11,11 +11,11 @@ * @param width=800 {Number} the width of the renderers view * @param height=600 {Number} the height of the renderers view * @param [view] {Canvas} the canvas to use as a view, optional - * @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment) * @param [transparent=false] {Boolean} the transparency of the render view, default false + * @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment) * */ -PIXI.autoDetectRenderer = function(width, height, view,antialias,transparent) +PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias) { if(!width)width = 800; if(!height)height = 600; diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index ea66c5b..7a3c7b1 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -16,7 +16,7 @@ PIXI.CANVAS_RENDERER = 1; // useful for testing against if your lib is using pixi. -PIXI.VERSION = "v1.4.4"; +PIXI.VERSION = "v1.5.0"; // the various blend modes supported by pixi PIXI.blendModes = { diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index c5dc209..d40cd56 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -466,8 +466,8 @@ * @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 */ -PIXI.Sprite.fromImage = function(imageId) +PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode) { - var texture = PIXI.Texture.fromImage(imageId); + var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode); return new PIXI.Sprite(texture); }; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 7810640..35105d7 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -169,6 +169,8 @@ fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY}; this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -188,6 +190,8 @@ this.currentPath.points.push(x, y); this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -202,6 +206,8 @@ { this.currentPath.points.push(x, y); this.dirty = true; + + return this; }; /** @@ -218,6 +224,8 @@ this.filling = true; this.fillColor = color || 0; this.fillAlpha = (arguments.length < 2) ? 1 : alpha; + + return this; }; /** @@ -230,6 +238,8 @@ this.filling = false; this.fillColor = null; this.fillAlpha = 1; + + return this; }; /** @@ -250,6 +260,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -271,6 +283,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -293,6 +307,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -310,6 +326,8 @@ this.graphicsData = []; this.bounds = null; //new PIXI.Rectangle(); + + return this; }; /** diff --git a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js index 60de6b4..0a63b34 100644 --- a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js @@ -273,7 +273,7 @@ // set the textures uvs temporarily // TODO create a separate texture so that we can tile part of a texture - if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8); + if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); var uvs = tilingSprite._uvs; @@ -298,7 +298,6 @@ uvs.x3 = 0 - offsetX; uvs.y3 = (1 *scaleY) - offsetY; - // get the tilingSprites current alpha var alpha = tilingSprite.worldAlpha; var tint = tilingSprite.tint; diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index 3d4b2c3..dea205a 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -11,11 +11,11 @@ * @param width=800 {Number} the width of the renderers view * @param height=600 {Number} the height of the renderers view * @param [view] {Canvas} the canvas to use as a view, optional - * @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment) * @param [transparent=false] {Boolean} the transparency of the render view, default false + * @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment) * */ -PIXI.autoDetectRenderer = function(width, height, view,antialias,transparent) +PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias) { if(!width)width = 800; if(!height)height = 600; diff --git a/src/pixi/utils/EventTarget.js b/src/pixi/utils/EventTarget.js index a772a44..300d287 100644 --- a/src/pixi/utils/EventTarget.js +++ b/src/pixi/utils/EventTarget.js @@ -11,7 +11,7 @@ * Adds event emitter functionality to a class * * @class EventTarget - * + * @example * function MyEmitter() { * PIXI.EventTarget.call(this); //mixes in event target stuff * } diff --git a/Gruntfile.js b/Gruntfile.js index 5832524..d0215a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadTasks('tasks'); diff --git a/examples/example 13 - Graphics/indexLineTest.html b/examples/example 13 - Graphics/indexLineTest.html index 3a63325..21d460a 100644 --- a/examples/example 13 - Graphics/indexLineTest.html +++ b/examples/example 13 - Graphics/indexLineTest.html @@ -25,8 +25,7 @@ var sprite= PIXI.Sprite.fromImage("spinObj_02.png"); //stage.addChild(sprite); // create a renderer instance - // the 5the parameter is the anti aliasing - var renderer = PIXI.autoDetectRenderer(620, 380, null, false, true); + var renderer = PIXI.autoDetectRenderer(620, 380, null, false /* transparent */, true /* antialias */); // set the canvas width and height to fill the screen //renderer.view.style.width = window.innerWidth + "px"; diff --git a/examples/example 7 - Transparent Background/index.html b/examples/example 7 - Transparent Background/index.html index 019f645..6c9bdb8 100644 --- a/examples/example 7 - Transparent Background/index.html +++ b/examples/example 7 - Transparent Background/index.html @@ -32,7 +32,8 @@ // create a renderer instance - var renderer = PIXI.autoDetectRenderer(400, 300,false,true); + var renderer = PIXI.autoDetectRenderer(400, 300, null, true, true); + // add the renderer view element to the DOM document.body.appendChild(renderer.view); diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index ea66c5b..7a3c7b1 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -16,7 +16,7 @@ PIXI.CANVAS_RENDERER = 1; // useful for testing against if your lib is using pixi. -PIXI.VERSION = "v1.4.4"; +PIXI.VERSION = "v1.5.0"; // the various blend modes supported by pixi PIXI.blendModes = { diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index c5dc209..d40cd56 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -466,8 +466,8 @@ * @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 */ -PIXI.Sprite.fromImage = function(imageId) +PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode) { - var texture = PIXI.Texture.fromImage(imageId); + var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode); return new PIXI.Sprite(texture); }; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 7810640..35105d7 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -169,6 +169,8 @@ fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY}; this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -188,6 +190,8 @@ this.currentPath.points.push(x, y); this.graphicsData.push(this.currentPath); + + return this; }; /** @@ -202,6 +206,8 @@ { this.currentPath.points.push(x, y); this.dirty = true; + + return this; }; /** @@ -218,6 +224,8 @@ this.filling = true; this.fillColor = color || 0; this.fillAlpha = (arguments.length < 2) ? 1 : alpha; + + return this; }; /** @@ -230,6 +238,8 @@ this.filling = false; this.fillColor = null; this.fillAlpha = 1; + + return this; }; /** @@ -250,6 +260,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -271,6 +283,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -293,6 +307,8 @@ this.graphicsData.push(this.currentPath); this.dirty = true; + + return this; }; /** @@ -310,6 +326,8 @@ this.graphicsData = []; this.bounds = null; //new PIXI.Rectangle(); + + return this; }; /** diff --git a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js index 60de6b4..0a63b34 100644 --- a/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ b/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js @@ -273,7 +273,7 @@ // set the textures uvs temporarily // TODO create a separate texture so that we can tile part of a texture - if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8); + if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); var uvs = tilingSprite._uvs; @@ -298,7 +298,6 @@ uvs.x3 = 0 - offsetX; uvs.y3 = (1 *scaleY) - offsetY; - // get the tilingSprites current alpha var alpha = tilingSprite.worldAlpha; var tint = tilingSprite.tint; diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index 3d4b2c3..dea205a 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -11,11 +11,11 @@ * @param width=800 {Number} the width of the renderers view * @param height=600 {Number} the height of the renderers view * @param [view] {Canvas} the canvas to use as a view, optional - * @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment) * @param [transparent=false] {Boolean} the transparency of the render view, default false + * @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment) * */ -PIXI.autoDetectRenderer = function(width, height, view,antialias,transparent) +PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias) { if(!width)width = 800; if(!height)height = 600; diff --git a/src/pixi/utils/EventTarget.js b/src/pixi/utils/EventTarget.js index a772a44..300d287 100644 --- a/src/pixi/utils/EventTarget.js +++ b/src/pixi/utils/EventTarget.js @@ -11,7 +11,7 @@ * Adds event emitter functionality to a class * * @class EventTarget - * + * @example * function MyEmitter() { * PIXI.EventTarget.call(this); //mixes in event target stuff * } diff --git a/test/karma.conf.js b/test/karma.conf.js index 6c63217..86715ab 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -57,8 +57,8 @@ browsers : ['Firefox'], // If browser does not capture in given timeout [ms], kill it - // CLI --capture-timeout 5000 - captureTimeout : 5000, + // CLI --capture-timeout 60000 + captureTimeout : 60000, // Auto run tests on start (when browsers are captured) and exit // CLI --single-run --no-single-run