Updated from BaseFX to Controller

This commit is contained in:
Richard Davey 2023-02-17 01:08:52 +00:00
parent 92152c16cf
commit a56ab63f27
15 changed files with 60 additions and 60 deletions

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Barrel
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Barrel = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -29,7 +29,7 @@ var Barrel = new Class({
{
if (amount === undefined) { amount = 1; }
BaseFX.call(this, FX_CONST.BARREL, gameObject);
Controller.call(this, FX_CONST.BARREL, gameObject);
/**
* The amount of distortion applied to the barrel effect.

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Bloom
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Bloom = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -33,7 +33,7 @@ var Bloom = new Class({
if (strength === undefined) { strength = 1; }
if (steps === undefined) { steps = 4; }
BaseFX.call(this, FX_CONST.BLOOM, gameObject);
Controller.call(this, FX_CONST.BLOOM, gameObject);
/**
* The number of steps to run the Bloom effect for.

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Blur
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Blur = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -33,7 +33,7 @@ var Blur = new Class({
if (strength === undefined) { strength = 1; }
if (steps === undefined) { steps = 4; }
BaseFX.call(this, FX_CONST.BLUR, gameObject);
Controller.call(this, FX_CONST.BLUR, gameObject);
/**
* The quality of the blur effect.

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Bokeh
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Bokeh = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -35,7 +35,7 @@ var Bokeh = new Class({
if (blurY === undefined) { blurY = 1; }
if (strength === undefined) { strength = 1; }
BaseFX.call(this, FX_CONST.BOKEH, gameObject);
Controller.call(this, FX_CONST.BOKEH, gameObject);
this.radius = radius;
this.amount = amount;

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Circle
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Circle = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -31,7 +31,7 @@ var Circle = new Class({
if (scale === undefined) { scale = 1; }
if (feather === undefined) { feather = 0.005; }
BaseFX.call(this, FX_CONST.CIRCLE, gameObject);
Controller.call(this, FX_CONST.CIRCLE, gameObject);
/**
* The scale of the circle. The default scale is 1, which is a circle

View file

@ -9,7 +9,7 @@ var Class = require('../utils/Class');
/**
* @classdesc
*
* @class BaseFX
* @class Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -17,16 +17,16 @@ var Class = require('../utils/Class');
* @param {number} type - The FX Type constant.
* @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx.
*/
var BaseFX = new Class({
var Controller = new Class({
initialize:
function BaseFX (type, gameObject)
function Controller (type, gameObject)
{
/**
* The FX_CONST type of this effect.
*
* @name Phaser.FX.BaseFX#type
* @name Phaser.FX.Controller#type
* @type {number}
* @since 3.60.0
*/
@ -35,7 +35,7 @@ var BaseFX = new Class({
/**
* A reference to the Game Object that owns this effect.
*
* @name Phaser.FX.BaseFX#gameObject
* @name Phaser.FX.Controller#gameObject
* @type {Phaser.GameObjects.GameObject}
* @since 3.60.0
*/
@ -45,7 +45,7 @@ var BaseFX = new Class({
* Toggle this boolean to enable or disable this effect,
* without removing and adding it from the Game Object.
*
* @name Phaser.FX.BaseFX#active
* @name Phaser.FX.Controller#active
* @type {boolean}
* @since 3.60.0
*/
@ -59,4 +59,4 @@ var BaseFX = new Class({
});
module.exports = BaseFX;
module.exports = Controller;

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Displacement
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Displacement = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -31,7 +31,7 @@ var Displacement = new Class({
if (x === undefined) { x = 0.005; }
if (y === undefined) { y = 0.005; }
BaseFX.call(this, FX_CONST.DISPLACEMENT, gameObject);
Controller.call(this, FX_CONST.DISPLACEMENT, gameObject);
this.x = x;
this.y = y;

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Glow
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Glow = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -32,7 +32,7 @@ var Glow = new Class({
if (innerStrength === undefined) { innerStrength = 0; }
if (knockout === undefined) { knockout = false; }
BaseFX.call(this, FX_CONST.GLOW, gameObject);
Controller.call(this, FX_CONST.GLOW, gameObject);
/**
* The distance of the glow.

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Gradient
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Gradient = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -34,7 +34,7 @@ var Gradient = new Class({
if (toY === undefined) { toY = 1; }
if (size === undefined) { size = 0; }
BaseFX.call(this, FX_CONST.GRADIENT, gameObject);
Controller.call(this, FX_CONST.GRADIENT, gameObject);
this.alpha = alpha;

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Pixelate
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Pixelate = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -29,7 +29,7 @@ var Pixelate = new Class({
{
if (amount === undefined) { amount = 1; }
BaseFX.call(this, FX_CONST.PIXELATE, gameObject);
Controller.call(this, FX_CONST.PIXELATE, gameObject);
this.amount = amount;
}

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Shadow
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Shadow = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -34,7 +34,7 @@ var Shadow = new Class({
if (samples === undefined) { samples = 6; }
if (intensity === undefined) { intensity = 1; }
BaseFX.call(this, FX_CONST.SHADOW, gameObject);
Controller.call(this, FX_CONST.SHADOW, gameObject);
this.x = x;
this.y = y;

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Shine
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Shine = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -32,7 +32,7 @@ var Shine = new Class({
if (gradient === undefined) { gradient = 3; }
if (reveal === undefined) { reveal = false; }
BaseFX.call(this, FX_CONST.SHINE, gameObject);
Controller.call(this, FX_CONST.SHINE, gameObject);
this.speed = 0.5;
this.lineWidth = 0.5;

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Vignette
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Vignette = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -32,7 +32,7 @@ var Vignette = new Class({
if (radius === undefined) { radius = 0.5; }
if (strength === undefined) { strength = 0.5; }
BaseFX.call(this, FX_CONST.VIGNETTE, gameObject);
Controller.call(this, FX_CONST.VIGNETTE, gameObject);
this.x = x;
this.y = y;

View file

@ -4,15 +4,15 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BaseFX = require('./BaseFX');
var Class = require('../utils/Class');
var Controller = require('./Controller');
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Wipe
* @extends Phaser.FX.BaseFX
* @extends Phaser.FX.Controller
* @memberof Phaser.FX
* @constructor
* @since 3.60.0
@ -21,7 +21,7 @@ var FX_CONST = require('./const');
*/
var Wipe = new Class({
Extends: BaseFX,
Extends: Controller,
initialize:
@ -32,7 +32,7 @@ var Wipe = new Class({
if (axis === undefined) { axis = 0; }
if (reveal === undefined) { reveal = false; }
BaseFX.call(this, FX_CONST.WIPE, gameObject);
Controller.call(this, FX_CONST.WIPE, gameObject);
// left to right: direction 0, axis 0
// right to left: direction 1, axis 0

View file

@ -14,7 +14,7 @@ var FX_CONST = require('./const');
var FX = {
Barrel: require('./Barrel'),
BaseFX: require('./BaseFX'),
Controller: require('./Controller'),
Bloom: require('./Bloom'),
Blur: require('./Blur'),
Bokeh: require('./Bokeh'),