Creates a new Texture using the given source and dimensions.
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. |
The Texture that was created, or null
if the key is already in use.