Creates a new Texture using the given source and dimensions.
name | type | arguments | description |
---|---|---|---|
key | string |
The unique string-based key of the Texture. |
|
source | HTMLImageElement | HTMLCanvasElement | Array.<HTMLImageElement> | Array.<HTMLCanvasElement> | Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper |
An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. |
|
width | number | <optional> |
The width of the Texture. This is optional and automatically derived from the source images. |
height | number | <optional> |
The height of the Texture. This is optional and automatically derived from the source images. |
The Texture that was created, or null
if the key is already in use.