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:
- Drop an animation block on the scene:
- Or you can convert an Image or TileSprite into a Sprite.
Learn more about type conversion
If you create a sprite, probably you want to play an animation with it. To do this you can set the Animation properties.
The Sprite type has properties common to other object types: