Phaser. Filter

new Filter(game, uniforms, fragmentSrc)

This is a base Filter class to use for any Phaser filter development.

Parameters:
Name Type Description
game Phaser.Game

A reference to the currently running game.

uniforms object

Uniform mappings object

fragmentSrc Array | string

The fragment shader code. Either an array, one element per line of code, or a string.

Source - core/Filter.js, line 16

Members

dirty :boolean

Internal PIXI var.

Default Value:
  • true
Source - core/Filter.js, line 47

fragmentSrc :array|string

The fragment shader code.

Type:
  • array | string
Source - core/Filter.js, line 95

game :Phaser.Game

A reference to the currently running game.

Source - core/Filter.js, line 21

height :number

The height (resolution uniform)

Source - core/Filter.js, line 176

padding :number

Internal PIXI var.

Default Value:
  • 0
Source - core/Filter.js, line 53

prevPoint :Phaser.Point

The previous position of the pointer (we don't update the uniform if the same)

Source - core/Filter.js, line 58

type :number

The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER.

Source - core/Filter.js, line 27

uniforms :object

Default uniform mappings. Compatible with ShaderToy and GLSLSandbox.

Source - core/Filter.js, line 69

width :number

The width (resolution uniform)

Source - core/Filter.js, line 160

Methods

destroy()

Clear down this Filter and null out references

Source - core/Filter.js, line 146

init()

Should be over-ridden.

Source - core/Filter.js, line 101

setResolution(width, height)

Set the resolution uniforms on the filter.

Parameters:
Name Type Description
width number

The width of the display.

height number

The height of the display.

Source - core/Filter.js, line 109

update(pointer)

Updates the filter.

Parameters:
Name Type Argument Description
pointer Phaser.Pointer <optional>

A Pointer object to use for the filter. The coordinates are mapped to the mouse uniform.

Source - core/Filter.js, line 122
Phaser Copyright © 2012-2015 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-alpha10 on Fri Jul 24 2015 13:29:49 GMT+0100 (GMT Daylight Time) using the DocStrap template.