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 | <optional> | The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default. | |
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 |
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/GameObjectFactory.js (Line 173)
Please login to continue.