mirror of
https://github.com/wassname/phaser.git
synced 2026-06-29 16:30:29 +08:00
Updated Filter resolution to a 2f and added Blur and Marble filters.
This commit is contained in:
+11
-4
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user