Namespace: Group

Phaser.Types.GameObjects. Group

Type Definitions


GroupCallback(item)

Parameters:
Name Type Description
item Phaser.GameObjects.GameObject

A group member

Since: 3.0.0
Source: src/gameobjects/group/typedefs/GroupCallback.js (Line 1)

GroupConfig

Type:
  • object
Properties:
Name Type Argument Default Description
classType function <optional>
<nullable>
Sprite

Sets Phaser.GameObjects.Group#classType.

name string <optional>
<nullable>
''

Sets Phaser.GameObjects.Group#name.

active boolean <optional>
<nullable>
true

Sets Phaser.GameObjects.Group#active.

maxSize number <optional>
<nullable>
-1

Sets Phaser.GameObjects.Group#maxSize.

defaultKey string <optional>
<nullable>
null

Sets Phaser.GameObjects.Group#defaultKey.

defaultFrame string | integer <optional>
<nullable>
null

Sets Phaser.GameObjects.Group#defaultFrame.

runChildUpdate boolean <optional>
<nullable>
false

Sets Phaser.GameObjects.Group#runChildUpdate.

createCallback Phaser.Types.GameObjects.Group.GroupCallback <optional>
<nullable>
null

Sets Phaser.GameObjects.Group#createCallback.

removeCallback Phaser.Types.GameObjects.Group.GroupCallback <optional>
<nullable>
null

Sets Phaser.GameObjects.Group#removeCallback.

createMultipleCallback Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback <optional>
<nullable>
null

Sets Phaser.GameObjects.Group#createMultipleCallback.

Since: 3.0.0
Source: src/gameobjects/group/typedefs/GroupConfig.js (Line 1)

GroupCreateConfig

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.

Type:
  • object
Properties:
Name Type Argument Default Description
classType function <optional>
<nullable>

The class of each new Game Object.

key string | Array.<string> <optional>

The texture key of each new Game Object.

frame string | Array.<string> | integer | Array.<integer> <optional>
<nullable>
null

The texture frame of each new Game Object.

visible boolean <optional>
<nullable>
true

The visible state of each new Game Object.

active boolean <optional>
<nullable>
true

The active state of each new Game Object.

repeat number <optional>
<nullable>
0

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

randomKey boolean <optional>
<nullable>
false

Select a key at random.

randomFrame boolean <optional>
<nullable>
false

Select a frame at random.

yoyo boolean <optional>
<nullable>
false

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

frameQuantity number <optional>
<nullable>
1

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

max number <optional>
<nullable>
0

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

setXY object <optional>
<nullable>
Properties
Name Type Argument Default Description
x number <optional>
<nullable>
0

The horizontal position of each new Game Object.

y number <optional>
<nullable>
0

The vertical position of each new Game Object.

stepX number <optional>
<nullable>
0

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

stepY number <optional>
<nullable>
0

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

setRotation object <optional>
<nullable>
Properties
Name Type Argument Default Description
value number <optional>
<nullable>
0

Rotation of each new Game Object.

step number <optional>
<nullable>
0

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

setScale object <optional>
<nullable>
Properties
Name Type Argument Default Description
x number <optional>
<nullable>
0

The horizontal scale of each new Game Object.

y number <optional>
<nullable>
0

The vertical scale of each new Game Object.

stepX number <optional>
<nullable>
0

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

stepY number <optional>
<nullable>
0

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

setAlpha object <optional>
<nullable>
Properties
Name Type Argument Default Description
value number <optional>
<nullable>
0

The alpha value of each new Game Object.

step number <optional>
<nullable>
0

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

hitArea * <optional>
<nullable>

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

hitAreaCallback Phaser.Types.Input.HitAreaCallback <optional>
<nullable>

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

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

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

Since: 3.0.0
Source: src/gameobjects/group/typedefs/GroupCreateConfig.js (Line 1)
See:

GroupMultipleCreateCallback(items)

Parameters:
Name Type Description
items Array.<Phaser.GameObjects.GameObject>

The newly created group members

Since: 3.0.0
Source: src/gameobjects/group/typedefs/GroupMultipleCreateCallback.js (Line 1)