diff --git a/README.md b/README.md index a6b88205..c45e4246 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ Try out 150+ [Phaser Examples](http://gametest.mobi/phaser/examples/) [Un-official Getting Started with Phaser](http://www.antonoffplus.com/coding-an-html5-game-for-30-minutes-or-an-introduction-to-the-phaser-framework) +[Subscribe to our new Phaser Newsletter](https://confirmsubscription.com/h/r/369DE48E3E86AF1E). We'll email you when new versions are released as well as send you our regular Phaser game making magazine. + "Being negative is not how we make progress" - Larry Page, Google Welcome to Phaser diff --git a/examples/assets/sprites/phaser.png b/examples/assets/sprites/phaser.png new file mode 100644 index 00000000..c824db91 Binary files /dev/null and b/examples/assets/sprites/phaser.png differ diff --git a/examples/wip/filter.js b/examples/wip/filter.js new file mode 100644 index 00000000..10e863ac --- /dev/null +++ b/examples/wip/filter.js @@ -0,0 +1,68 @@ +PIXI.GreyFilter = function() +{ + PIXI.AbstractFilter.call( this ); + + this.passes = [this]; + + // set the uniforms + this.uniforms = { + grey: {type: 'f', value: 1}, + }; + + this.OLDfragmentSrc = [ + "precision mediump float;", + "varying vec2 vTextureCoord;", + "varying float vColor;", + "uniform sampler2D uSampler;", + "uniform float grey;", + "void main(void) {", + "gl_FragColor = texture2D(uSampler, vTextureCoord);", + "gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), grey);", + "gl_FragColor = gl_FragColor * vColor;", + "}" + ]; + + + + + +} + +PIXI.GreyFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); +PIXI.GreyFilter.prototype.constructor = PIXI.GreyFilter; + +/** +The strength of the grey. 1 will make the object black and white, 0 will make the object its normal color +@property grey +*/ +Object.defineProperty(PIXI.GreyFilter.prototype, 'grey', { + get: function() { + return this.uniforms.grey.value; + }, + set: function(value) { + this.uniforms.grey.value = value; + } +}); + +var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); + +function preload() { + + game.load.image('atari1', 'assets/sprites/atari130xe.png'); + game.load.image('coke', 'assets/sprites/cokecan.png'); + game.load.image('mushroom', 'assets/sprites/mushroom2.png'); + +} + +function create() { + + game.add.sprite(60, 100, 'atari1'); + game.add.sprite(360, 200, 'coke'); + +} + +function update() { +} + +function render() { +} diff --git a/examples/wip/filterconv.php b/examples/wip/filterconv.php new file mode 100644 index 00000000..852155f0 --- /dev/null +++ b/examples/wip/filterconv.php @@ -0,0 +1,45 @@ + + + + + + phaser - filter conv + + + + +
+ +

Input

+ + +

Output

+ + +
+ + + +
+ + + \ No newline at end of file diff --git a/resources/Phaser Logo/PNG/Phaser-2D-Flat.png b/resources/Phaser Logo/PNG/Phaser-2D-Flat.png new file mode 100644 index 00000000..0f5bbf7a Binary files /dev/null and b/resources/Phaser Logo/PNG/Phaser-2D-Flat.png differ diff --git a/resources/Phaser Logo/PNG/Phaser-2D-Flat.psd b/resources/Phaser Logo/PNG/Phaser-2D-Flat.psd new file mode 100644 index 00000000..cabaa6a0 Binary files /dev/null and b/resources/Phaser Logo/PNG/Phaser-2D-Flat.psd differ diff --git a/src/animation/Animation.js b/src/animation/Animation.js index 3c1ff326..aaf8cfeb 100644 --- a/src/animation/Animation.js +++ b/src/animation/Animation.js @@ -270,7 +270,11 @@ Phaser.Animation.prototype = { else { this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]); - this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); + + if (this.currentFrame) + { + this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); + } } return true; diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js index 256c8caa..62373bf7 100644 --- a/src/pixi/display/DisplayObject.js +++ b/src/pixi/display/DisplayObject.js @@ -474,7 +474,6 @@ PIXI.DisplayObject.prototype.removeFilter = function(data) { //if(!this.filter)return; //this.filter = false; - console.log("YUOIO") // modify the list.. var startBlock = data.start; diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js index 7a52a9f2..0cdf18a0 100644 --- a/src/pixi/renderers/webgl/WebGLRenderGroup.js +++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js @@ -25,7 +25,6 @@ PIXI.WebGLRenderGroup = function(gl, transparent) this.batchs = []; this.toRemove = []; - console.log(this.transparent) this.filterManager = new PIXI.WebGLFilterManager(this.transparent); } diff --git a/src/pixi/renderers/webgl/WebGLShaders.js b/src/pixi/renderers/webgl/WebGLShaders.js index 44123d27..30bb1976 100644 --- a/src/pixi/renderers/webgl/WebGLShaders.js +++ b/src/pixi/renderers/webgl/WebGLShaders.js @@ -93,7 +93,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType) gl.compileShader(shader); if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { - console.log(gl.getShaderInfoLog(shader)); return null; }