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
- Since: 3.0.0
- Source: src/gameobjects/group/typedefs/GroupConfig.js (Line 1)
Properties:
Name Type Argument Default Description classType
function <optional>
<nullable>
Sprite name
string <optional>
<nullable>
'' active
boolean <optional>
<nullable>
true maxSize
number <optional>
<nullable>
-1 defaultKey
string <optional>
<nullable>
null defaultFrame
string | number <optional>
<nullable>
null runChildUpdate
boolean <optional>
<nullable>
false createCallback
Phaser.Types.GameObjects.Group.GroupCallback <optional>
<nullable>
null removeCallback
Phaser.Types.GameObjects.Group.GroupCallback <optional>
<nullable>
null createMultipleCallback
Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback <optional>
<nullable>
null -
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 exceedmax
.key
is required. Phaser.GameObjects.Group#defaultKey is not used.Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/group/typedefs/GroupCreateConfig.js (Line 1)
- See:
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> | number | Array.<number> <optional>
<nullable>
null The texture frame of each new Game Object.
quantity
number <optional>
<nullable>
false The number of Game Objects to create. If set, this overrides the
frameQuantity
value. UseframeQuantity
for more advanced control.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
andframe
.frameQuantity
number <optional>
<nullable>
1 The number of times each
frame
should be combined with onekey
.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
.setOrigin
object <optional>
<nullable>
Properties
Name Type Argument Default Description x
number <optional>
<nullable>
0 The horizontal origin of each new Game Object.
y
number <optional>
<nullable>
0 The vertical origin of each new Game Object.
stepX
number <optional>
<nullable>
0 Increment each Game Object's horizontal origin from the previous by this amount, starting from
setOrigin.x
.stepY
number <optional>
<nullable>
0 Increment each Game object's vertical origin from the previous by this amount, starting from
setOrigin.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
.setDepth
object <optional>
<nullable>
Properties
Name Type Argument Default Description value
number <optional>
<nullable>
0 The depth value of each new Game Object.
step
number <optional>
<nullable>
0 Increment each Game Object's depth from the previous by this amount, starting from
setDepth.value
.setScrollFactor
object <optional>
<nullable>
Properties
Name Type Argument Default Description x
number <optional>
<nullable>
0 The horizontal scroll factor of each new Game Object.
y
number <optional>
<nullable>
0 The vertical scroll factor of each new Game Object.
stepX
number <optional>
<nullable>
0 Increment each Game Object's horizontal scroll factor from the previous by this amount, starting from
setScrollFactor.x
.stepY
number <optional>
<nullable>
0 Increment each Game object's vertical scroll factor from the previous by this amount, starting from
setScrollFactor.y
.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.
-
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)