Sprite objects

The Sprite is a built-in Phaser object type: Phaser.GameObjects.Sprite. It is like the Image type, but also it can play sprite animations. This means, that you may use a Sprite object only if it will be animated in the game, otherwise, the better is to use an Image.

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

const player = this.add.sprite(192, 512, "dragon-atlas", "idle-000");

To create a Sprite object, you can drop a Sprite built-in block on the scene. Or you can convert an Image or TileSprite into a Sprite.

Learn more about type conversion

Create an empty Sprite.

The Sprite type has properties common to other object types: