GameObjectCreator#group()

group(parent, name, addToStage, enableBody, physicsBodyType) → {Phaser.Group}

A Group is a container for display objects that allows for fast pooling, recycling and collision checks.

Parameters
Name Type Argument Default Description
parent any

The parent Group or DisplayObjectContainer that will hold this group, if any.

name string <optional>
'group'

A name for this Group. Not used internally but useful for debugging.

addToStage boolean <optional>
false

If set to true this Group will be added directly to the Game.Stage instead of Game.World.

enableBody boolean <optional>
false

If true all Sprites created with Group.create or Group.createMulitple will have a physics body created on them. Change the body type with physicsBodyType.

physicsBodyType number <optional>
0

If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.

Returns

The newly created Group.

Source code: gameobjects/GameObjectCreator.js (Line 83)
doc_phaser
2017-02-14 10:48:31
Comments
Leave a Comment

Please login to continue.