Phaser API Documentation

setTexture(gameObject, key, [frame])


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.


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.


The Game Object the texture was set on.

Since: 3.0.0