Updated Filter resolution to a 2f and added Blur and Marble filters.

This commit is contained in:
photonstorm
2013-11-29 12:26:53 +00:00
parent 378ffc7ade
commit 00a9897ae2
17 changed files with 219 additions and 77 deletions
+11 -4
View File
@@ -52,9 +52,9 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) {
*/
this.uniforms = {
resolution: { type: '3f', value: { x: 256, y: 256, z: 0 }},
time: { type: '1f', value: 0 },
mouse: { type: '4fv', value: { x: 0, y: 0, z: 0, w: 0 }}
resolution: { type: '2f', value: { x: 256, y: 256 }},
mouse: { type: '2f', value: { x: 0.0, y: 0.0 }}
};
@@ -97,8 +97,15 @@ Phaser.Filter.prototype = {
if (typeof pointer !== 'undefined')
{
this.uniforms.mouse.x = pointer.x;
this.uniforms.mouse.y = pointer.y;
if (pointer.x > 0)
{
this.uniforms.mouse.x = pointer.x.toFixed(2);
}
if (pointer.y > 0)
{
this.uniforms.mouse.y = pointer.y.toFixed(2);
}
}
this.uniforms.time.value = this.game.time.totalElapsedSeconds();
+2 -2
View File
@@ -67,7 +67,7 @@ Phaser.Loader = function (game) {
/**
* You can optionally link a sprite to the preloader.
* If you do so the Sprite's width or height will be cropped based on the percentage loaded.
* @property {Description} preloadSprite
* @property {Phaser.Sprite} preloadSprite
* @default
*/
this.preloadSprite = null;
@@ -1058,7 +1058,7 @@ Phaser.Loader.prototype = {
file.data = document.createElement('script');
file.data.language = 'javascript';
file.data.type = 'text/javascript';
file.data.defer = true;
file.data.defer = false;
file.data.text = this._xhr.responseText;
document.head.appendChild(file.data);
break;