Phaser API Documentation

  Version: 
addCanvas(key, source, [skipCache])

Description:

Creates a new Canvas Texture object from an existing Canvas element and adds it to this Texture Manager, unless skipCache is true.

Parameters:

name type arguments Default description
key string

The unique string-based key of the Texture.

source HTMLCanvasElement

The Canvas element to form the base of the new Texture.

skipCache boolean <optional> false

Skip adding this Texture into the Cache?

Returns:
Description:

The Canvas Texture that was created, or null if the key is already in use.

Since: 3.0.0