Skip to main content
Version: Phaser v3.90.0

Types.GameObjects.Group

GroupCallback

<static> GroupCallback

Type: function

Member of: Phaser.Types.GameObjects.Group

Source: src/gameobjects/group/typedefs/GroupCallback.js#L1
Since: 3.0.0


GroupClassTypeConstructor

<static> GroupClassTypeConstructor

Type: function

Member of: Phaser.Types.GameObjects.Group

Source: src/gameobjects/group/typedefs/GroupClassTypeConstructor.js#L1
Since: 3.0.0


GroupConfig

<static> GroupConfig

nametypeoptionaldefaultdescription
classTypefunctionYes"Sprite"Sets {@link Phaser.GameObjects.Group#classType}.
namestringYes"''"Sets {@link Phaser.GameObjects.Group#name}.
activebooleanYestrueSets {@link Phaser.GameObjects.Group#active}.
maxSizenumberYes-1Sets {@link Phaser.GameObjects.Group#maxSize}.
defaultKeystringYesnullSets {@link Phaser.GameObjects.Group#defaultKey}.
defaultFramestring | numberYesnullSets {@link Phaser.GameObjects.Group#defaultFrame}.
runChildUpdatebooleanYesfalseSets {@link Phaser.GameObjects.Group#runChildUpdate}.
createCallbackPhaser.Types.GameObjects.Group.GroupCallbackYesnullSets {@link Phaser.GameObjects.Group#createCallback}.
removeCallbackPhaser.Types.GameObjects.Group.GroupCallbackYesnullSets {@link Phaser.GameObjects.Group#removeCallback}.
createMultipleCallbackPhaser.Types.GameObjects.Group.GroupMultipleCreateCallbackYesnullSets {@link Phaser.GameObjects.Group#createMultipleCallback}.

Type: object

Member of: Phaser.Types.GameObjects.Group

Source: src/gameobjects/group/typedefs/GroupConfig.js#L1
Since: 3.0.0


GroupCreateConfig

<static> 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. {@link Phaser.GameObjects.Group#defaultKey} is not used.

nametypeoptionaldefaultdescription
keystring | Array.<string>NoThe texture key of each new Game Object. Must be provided or not objects will be created.
classTypefunctionYesThe class of each new Game Object.
framestring | Array.<string>numberArray.<number>Yes
quantitynumberYesfalseThe number of Game Objects to create. If set, this overrides the frameQuantity value. Use frameQuantity for more advanced control.
visiblebooleanYestrueThe visible state of each new Game Object.
activebooleanYestrueThe active state of each new Game Object.
repeatnumberYes0The number of times each key × frame combination will be repeated (after the first combination).
randomKeybooleanYesfalseSelect a key at random.
randomFramebooleanYesfalseSelect a frame at random.
yoyobooleanYesfalseSelect keys and frames by moving forward then backward through key and frame.
frameQuantitynumberYes1The number of times each frame should be combined with one key.
maxnumberYes0The maximum number of new Game Objects to create. 0 is no maximum.
setXYobjectYesNo description provided
setXY.xnumberYes0The horizontal position of each new Game Object.
setXY.ynumberYes0The vertical position of each new Game Object.
setXY.stepXnumberYes0Increment each Game Object's horizontal position from the previous by this amount, starting from setXY.x.
setXY.stepYnumberYes0Increment each Game Object's vertical position from the previous by this amount, starting from setXY.y.
setRotationobjectYesNo description provided
setRotation.valuenumberYes0Rotation of each new Game Object.
setRotation.stepnumberYes0Increment each Game Object's rotation from the previous by this amount, starting at setRotation.value.
setScaleobjectYesNo description provided
setScale.xnumberYes0The horizontal scale of each new Game Object.
setScale.ynumberYes0The vertical scale of each new Game Object.
setScale.stepXnumberYes0Increment each Game Object's horizontal scale from the previous by this amount, starting from setScale.x.
setScale.stepYnumberYes0Increment each Game object's vertical scale from the previous by this amount, starting from setScale.y.
setOriginobjectYesNo description provided
setOrigin.xnumberYes0The horizontal origin of each new Game Object.
setOrigin.ynumberYes0The vertical origin of each new Game Object.
setOrigin.stepXnumberYes0Increment each Game Object's horizontal origin from the previous by this amount, starting from setOrigin.x.
setOrigin.stepYnumberYes0Increment each Game object's vertical origin from the previous by this amount, starting from setOrigin.y.
setAlphaobjectYesNo description provided
setAlpha.valuenumberYes0The alpha value of each new Game Object.
setAlpha.stepnumberYes0Increment each Game Object's alpha from the previous by this amount, starting from setAlpha.value.
setDepthobjectYesNo description provided
setDepth.valuenumberYes0The depth value of each new Game Object.
setDepth.stepnumberYes0Increment each Game Object's depth from the previous by this amount, starting from setDepth.value.
setScrollFactorobjectYesNo description provided
setScrollFactor.xnumberYes0The horizontal scroll factor of each new Game Object.
setScrollFactor.ynumberYes0The vertical scroll factor of each new Game Object.
setScrollFactor.stepXnumberYes0Increment each Game Object's horizontal scroll factor from the previous by this amount, starting from setScrollFactor.x.
setScrollFactor.stepYnumberYes0Increment each Game object's vertical scroll factor from the previous by this amount, starting from setScrollFactor.y.
hitArea*YesA geometric shape that defines the hit area for the Game Object.
hitAreaCallbackPhaser.Types.Input.HitAreaCallbackYesA callback to be invoked when the Game Object is interacted with.
gridAlignfalse | Phaser.Types.Actions.GridAlignConfigYesfalseAlign the new Game Objects in a grid using these settings.

Type: object

Member of: Phaser.Types.GameObjects.Group

Source: src/gameobjects/group/typedefs/GroupCreateConfig.js#L1
Since: 3.0.0


GroupMultipleCreateCallback

<static> GroupMultipleCreateCallback

Type: function

Member of: Phaser.Types.GameObjects.Group

Source: src/gameobjects/group/typedefs/GroupMultipleCreateCallback.js#L1
Since: 3.0.0