# Class: Filter

## Phaser. Filter

Phaser - Filter

#### new Filter(game, uniforms, fragmentSrc)

  This is a base Filter template 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 | The fragment shader code.

  Source:
    - core/Filter.js, line 17

### Members

#### dirty

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `dirty` | boolean | Internal PIXI var.

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

#### fragmentSrc

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `fragmentSrc` | array | The fragment shader code.

  Source:
    - core/Filter.js, line 70

#### game

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `game` | Phaser.Game | A reference to the currently running game.

  Source:
    - core/Filter.js, line 22

#### height

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `height` | number | The height (resolution uniform)

  Source:
    - core/Filter.js, line 151

#### padding

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `padding` | number | Internal PIXI var.

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

#### type

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `type` | number | The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER.

  Source:
    - core/Filter.js, line 28

#### uniforms

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `uniforms` | object | Default uniform mappings.

  Source:
    - core/Filter.js, line 59

#### width

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `width` | number | The width (resolution uniform)

  Source:
    - core/Filter.js, line 135

### Methods

#### destroy()

  Clear down this Filter and null out references

  Source:
    - core/Filter.js, line 121

#### init()

  Should be over-ridden.

  Source:
    - core/Filter.js, line 76

#### 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 84

#### 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 97