Barrel
The Barrel Filter Controller.
This filter controller manages the barrel distortion effect for a Camera. A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to the view. The amount of the effect can be modified in real-time.
A Barrel effect is added to a Camera via the FilterList component:
const camera = this.cameras.main;
camera.filters.internal.addBarrel();
camera.filters.external.addBarrel();
Constructor
new Barrel(camera, [amount])
Parameters
| name | type | optional | default | description |
|---|---|---|---|---|
| camera | Phaser.Cameras.Scene2D.Camera | No | The camera that owns this filter. | |
| amount | number | Yes | 1 | The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. |
Scope: static
Extends
Source: src/filters/Barrel.js#L10
Since: 4.0.0
Inherited Members
From Phaser.Filters.Controller:
Public Members
amount
amount: number
Description:
The amount of distortion applied to the barrel effect.
A value of 1 applies no distortion. Values above 1 expand the view outward (barrel distortion), while values below 1 pinch the view inward (pincushion distortion). Typically keep this within ±1 of the default value of 1.
Source: src/filters/Barrel.js#L44
Since: 4.0.0
Inherited Methods
From Phaser.Filters.Controller: