Skip to main content
Version: Phaser v4.0.0-rc.6

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

nametypeoptionaldefaultdescription
cameraPhaser.Cameras.Scene2D.CameraNoThe camera that owns this filter.
amountnumberYes1The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1.

Scope: static

Extends

Phaser.Filters.Controller

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.

Typically keep this within the range 1 (no distortion) to +- 1.

Source: src/filters/Barrel.js#L44
Since: 4.0.0


Inherited Methods

From Phaser.Filters.Controller: