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:
Members
-
dirty
-
- Default Value:
- true
- Source:
Properties:
Name Type Description dirty
boolean Internal PIXI var.
-
fragmentSrc
-
- Source:
Properties:
Name Type Description fragmentSrc
array The fragment shader code.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game A reference to the currently running game.
-
height
-
- Source:
Properties:
Name Type Description height
number The height (resolution uniform)
-
padding
-
- Default Value:
- 0
- Source:
Properties:
Name Type Description padding
number Internal PIXI var.
-
type
-
- Source:
Properties:
Name Type Description type
number The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER.
-
uniforms
-
- Source:
Properties:
Name Type Description uniforms
object Default uniform mappings.
-
width
-
- Source:
Properties:
Name Type Description width
number The width (resolution uniform)
Methods
-
destroy()
-
Clear down this Filter and null out references
- Source:
-
init()
-
Should be over-ridden.
- Source:
-
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:
-
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: