Phaser API Documentation

  Version: 
setTexture(gameObject, key, [frame])

Description:

Sets the given Game Objects texture and frame properties so that it uses the Texture and Frame specified in the key and frame arguments to this method.

Parameters:

name type arguments description
gameObject Phaser.GameObjects.GameObject

The Game Object the texture would be set on.

key string

The unique string-based key of the Texture.

frame string | number <optional>

The string or index of the Frame.

Returns:
Description:

The Game Object the texture was set on.

Since: 3.0.0