Phaser API Documentation

  Version: 
createTextureFromSource(source, width, height, scaleMode, [forceClamp])

Description:

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

Parameters:

name type arguments Default 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.

forceClamp boolean <optional> false

Force the texture to use the CLAMP_TO_EDGE wrap mode, even if a power of two?

Returns:
Description:

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

Type:
  • WebGLTexture
Since: 3.0.0