Phaser API Documentation

  Version: 
sprite(x, y, texture, [frame])

Description:

Creates a new Sprite Game Object and adds it to the Scene.

Note: This method will only be available if the Sprite Game Object has been built into Phaser.

Parameters:

name type arguments description
x number

The horizontal position of this Game Object in the world.

y number

The vertical position of this Game Object in the world.

texture string | Phaser.Textures.Texture

The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager.

frame string | number <optional>

An optional frame from the Texture this Game Object is rendering with.

Returns:
Description:

The Game Object that was created.

Since: 3.0.0