Phaser API Documentation

  Version: 
create(key, source, width, height)

Description:

Creates a new Texture using the given source and dimensions.

Parameters:

name type description
key string

The unique string-based key of the Texture.

source HTMLImageElement

The source Image element.

width number

The width of the Texture.

height number

The height of the Texture.

Returns:
Description:

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

Since: 3.0.0