Phaser API Documentation

  Version: 
create([x], [y], [key], [frame], [visible], [active])

Description:

Creates a new Game Object and adds it to this group, unless the group is.

Calls Phaser.GameObjects.Group#createCallback.

Parameters:

name type arguments Default description
x number <optional> 0

The horizontal position of the new Game Object in the world.

y number <optional> 0

The vertical position of the new Game Object in the world.

key string <optional> defaultKey

The texture key of the new Game Object.

frame string | number <optional> defaultFrame

The texture frame of the new Game Object.

visible boolean <optional> true

The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object.

active boolean <optional> true

The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object.

Returns:
Description:

The new Game Object (usually a Sprite, etc.).

Type:
  • any
Since: 3.0.0