Tile Sprite objects

The Tile Sprite is a built-in Phaser object type: Phaser.GameObjects.TileSprite. This type allows creating objects with repeating textures, like background elements.

A Tile Sprite is created in code using the tileSprite factory. This is how the scene compiler generates the code of a Tile Sprite:

// x = 0, y = 600, width = 600, height = 800, texture = "rocks_1"
const rocks = this.add.tileSprite(0, 600, 800, 225, "rocks_1");

To create a Tile Sprite object in the scene, you can drop a TileSprite built-in block on the scene.

Create default TileSprite object.

Or convert an Image or Sprite into a Tile Sprite.

Tile Sprite properties

The Tile Sprite type shares properties with other object types:

But also it has particular properties:

Tile sprite object.