Phaser API Documentation

  Version: 
createTextureFromSource(source, width, height, scaleMode)

Description:

Creates a texture from an image source. If the source is not valid it creates an empty texture.

Parameters:

name type description
source object

The source of the texture.

width number

The width of the texture.

height number

The height of the texture.

scaleMode number

The scale mode to be used by the texture.

Returns:
Description:

The WebGL Texture that was created, or null if it couldn't be created.

Type:
  • WebGLTexture
Since: 3.0.0