Phaser API Documentation

Only webGL shader(key, [x], [y], [width], [height], [textures], [textureData])


Creates a new Shader Game Object and adds it to the Scene.

Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser.


name type arguments Default description
key string | Phaser.Display.BaseShader

The key of the shader to use from the shader cache, or a BaseShader instance.

x number <optional> 0

The horizontal position of this Game Object in the world.

y number <optional> 0

The vertical position of this Game Object in the world.

width number <optional> 128

The width of the Game Object.

height number <optional> 128

The height of the Game Object.

textures Array.<string> <optional>

Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager.

textureData object <optional>

Optional additional texture data.


The Game Object that was created.

Since: 3.17.0