Phaser API Documentation

  Version: 
createCanvasTexture(srcCanvas, [noRepeat], [flipY])

Description:

Creates a new WebGL Texture based on the given Canvas Element.

Parameters:

name type arguments Default description
srcCanvas HTMLCanvasElement

The Canvas to create the WebGL Texture from

noRepeat boolean <optional> false

Should this canvas be allowed to set REPEAT (such as for Text objects?)

flipY boolean <optional> false

Should the WebGL Texture set UNPACK_MULTIPLY_FLIP_Y?

Returns:
Description:

The newly created WebGL Texture.

Type:
  • WebGLTexture
Since: 3.20.0