phaser/src/gameobjects/fx/BaseFX.js

63 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-02-13 21:21:18 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var Class = require('../../utils/Class');
/**
* @classdesc
*
* @class BaseFX
* @memberof Phaser.GameObjects.FX
* @constructor
* @since 3.60.0
*
* @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({
initialize:
function BaseFX (type, gameObject)
{
2023-02-16 22:15:22 +00:00
/**
* The FX_CONST type of this effect.
*
* @name Phaser.GameObjects.FX.BaseFX#type
* @type {number}
* @since 3.60.0
*/
2023-02-13 21:21:18 +00:00
this.type = type;
2023-02-16 22:15:22 +00:00
/**
* A reference to the Game Object that owns this effect.
*
* @name Phaser.GameObjects.FX.BaseFX#gameObject
* @type {Phaser.GameObjects.GameObject}
* @since 3.60.0
*/
2023-02-13 21:21:18 +00:00
this.gameObject = gameObject;
2023-02-16 22:15:22 +00:00
/**
* Toggle this boolean to enable or disable this effect,
* without removing and adding it from the Game Object.
*
* @name Phaser.GameObjects.FX.BaseFX#active
* @type {boolean}
* @since 3.60.0
*/
2023-02-13 21:21:18 +00:00
this.active = true;
},
destroy: function ()
{
this.gameObject = null;
}
});
module.exports = BaseFX;