Phaser API Documentation

  Version: 
setTexture(key, [frame])

Description:

Sets the texture and frame this Game Object will use to render with.

Textures are referenced by their string-based keys, as stored in the Texture Manager.

Parameters:

name type arguments description
key string

The key of the texture to be used, as stored in the Texture Manager.

frame string | number <optional>

The name or index of the frame within the Texture.

Returns:
Description:

This Game Object instance.

Since: 3.0.0