Phaser API Documentation

  Version: 
GroupCreateConfig

Description:

The total number of objects created will be

key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat)

If max is nonzero, then the total created will not exceed max.

key is required. Phaser.GameObjects.Group#defaultKey is not used.

Properties:
name type arguments Default description
classType function <optional>

The class of each new Game Object.

key string | Array.<string> <optional>

The texture key of each new Game Object.

frame string | Array.<string> | number | Array.<number> <optional> null

The texture frame of each new Game Object.

quantity number <optional> false

The number of Game Objects to create. If set, this overrides the frameQuantity value. Use frameQuantity for more advanced control.

visible boolean <optional> true

The visible state of each new Game Object.

active boolean <optional> true

The active state of each new Game Object.

repeat number <optional> 0

The number of times each key × frame combination will be repeated (after the first combination).

randomKey boolean <optional> false

Select a key at random.

randomFrame boolean <optional> false

Select a frame at random.

yoyo boolean <optional> false

Select keys and frames by moving forward then backward through key and frame.

frameQuantity number <optional> 1

The number of times each frame should be combined with one key.

max number <optional> 0

The maximum number of new Game Objects to create. 0 is no maximum.

setXY object <optional>
setXY.x number <optional> 0

The horizontal position of each new Game Object.

setXY.y number <optional> 0

The vertical position of each new Game Object.

setXY.stepX number <optional> 0

Increment each Game Object's horizontal position from the previous by this amount, starting from setXY.x.

setXY.stepY number <optional> 0

Increment each Game Object's vertical position from the previous by this amount, starting from setXY.y.

setRotation object <optional>
setRotation.value number <optional> 0

Rotation of each new Game Object.

setRotation.step number <optional> 0

Increment each Game Object's rotation from the previous by this amount, starting at setRotation.value.

setScale object <optional>
setScale.x number <optional> 0

The horizontal scale of each new Game Object.

setScale.y number <optional> 0

The vertical scale of each new Game Object.

setScale.stepX number <optional> 0

Increment each Game Object's horizontal scale from the previous by this amount, starting from setScale.x.

setScale.stepY number <optional> 0

Increment each Game object's vertical scale from the previous by this amount, starting from setScale.y.

setOrigin object <optional>
setOrigin.x number <optional> 0

The horizontal origin of each new Game Object.

setOrigin.y number <optional> 0

The vertical origin of each new Game Object.

setOrigin.stepX number <optional> 0

Increment each Game Object's horizontal origin from the previous by this amount, starting from setOrigin.x.

setOrigin.stepY number <optional> 0

Increment each Game object's vertical origin from the previous by this amount, starting from setOrigin.y.

setAlpha object <optional>
setAlpha.value number <optional> 0

The alpha value of each new Game Object.

setAlpha.step number <optional> 0

Increment each Game Object's alpha from the previous by this amount, starting from setAlpha.value.

setDepth object <optional>
setDepth.value number <optional> 0

The depth value of each new Game Object.

setDepth.step number <optional> 0

Increment each Game Object's depth from the previous by this amount, starting from setDepth.value.

setScrollFactor object <optional>
setScrollFactor.x number <optional> 0

The horizontal scroll factor of each new Game Object.

setScrollFactor.y number <optional> 0

The vertical scroll factor of each new Game Object.

setScrollFactor.stepX number <optional> 0

Increment each Game Object's horizontal scroll factor from the previous by this amount, starting from setScrollFactor.x.

setScrollFactor.stepY number <optional> 0

Increment each Game object's vertical scroll factor from the previous by this amount, starting from setScrollFactor.y.

hitArea * <optional>

A geometric shape that defines the hit area for the Game Object.

hitAreaCallback Phaser.Types.Input.HitAreaCallback <optional>

A callback to be invoked when the Game Object is interacted with.

gridAlign false | Phaser.Types.Actions.GridAlignConfig <optional> false

Align the new Game Objects in a grid using these settings.

Type:
object