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

BaseFilter

This is a base class for all filters.

It should not be used directly, but should be extended by all other filters.

Constructor

new BaseFilter(name, manager)

Parameters

nametypeoptionaldescription
namestringNoThe name of the filter.
managerPhaser.Renderer.WebGL.RenderNodes.RenderNodeManagerNoThe manager that owns this filter.

Scope: static

Extends

Phaser.Renderer.WebGL.RenderNodes.RenderNode

Source: src/renderer/webgl/renderNodes/filters/BaseFilter.js#L10
Since: 4.0.0

Inherited Methods

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Methods

run

<instance> run(controller, inputDrawingContext, [outputDrawingContext], [padding])

Description:

Run the filter. It returns a drawing context containing the output texture.

Parameters:

nametypeoptionaldescription
controllerPhaser.Filters.ControllerNoThe filter controller.
inputDrawingContextPhaser.Renderer.WebGL.DrawingContextNoThe drawing context containing the input texture. This is either the initial render, or the output of the previous filter. This will be released during the run process, and can no longer be used.
outputDrawingContextPhaser.Renderer.WebGL.DrawingContextYesThe drawing context where the output texture will be drawn. If not specified, a new drawing context will be generated. Generally, this parameter is used for the last filter in a chain, so the output texture is drawn to the main framebuffer.
paddingPhaser.Geom.RectangleYesThe padding to add to the input texture to create the output texture. If not specified, the controller is used to get the padding. This should be undefined for internal filters, so the controller will expand textures as needed; and defined as the negative padding of the previous filter for external filters, so the texture will shrink to the correct size.

Overrides: Phaser.Renderer.WebGL.RenderNodes.RenderNode#run

Returns: Phaser.Renderer.WebGL.DrawingContext - The drawing context containing the output texture.

Source: src/renderer/webgl/renderNodes/filters/BaseFilter.js#L32
Since: 4.0.0


Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.RenderNode: