phaser/src/fx/Vignette.js

46 lines
1 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}
*/
2023-02-16 23:49:14 +00:00
var Class = require('../utils/Class');
2023-02-17 01:08:52 +00:00
var Controller = require('./Controller');
2023-02-13 21:21:18 +00:00
var FX_CONST = require('./const');
/**
* @classdesc
*
* @class Vignette
2023-02-17 01:08:52 +00:00
* @extends Phaser.FX.Controller
2023-02-16 23:49:14 +00:00
* @memberof Phaser.FX
2023-02-13 21:21:18 +00:00
* @constructor
* @since 3.60.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - A reference to the Game Object that has this fx.
*/
var Vignette = new Class({
2023-02-17 01:08:52 +00:00
Extends: Controller,
2023-02-13 21:21:18 +00:00
initialize:
function Vignette (gameObject, x, y, radius, strength)
2023-02-13 21:21:18 +00:00
{
if (x === undefined) { x = 0.5; }
if (y === undefined) { y = 0.5; }
if (radius === undefined) { radius = 0.5; }
if (strength === undefined) { strength = 0.5; }
2023-02-17 01:08:52 +00:00
Controller.call(this, FX_CONST.VIGNETTE, gameObject);
2023-02-13 21:21:18 +00:00
this.x = x;
this.y = y;
this.radius = radius;
this.strength = strength;
2023-02-13 21:21:18 +00:00
}
});
module.exports = Vignette;