Skip to main content
Version: Phaser v4.0.0-rc.6

StaticGroup

An Arcade Physics Static Group object.

All Game Objects created by or added to this Group will automatically be given static Arcade Physics bodies, if they have no body.

Its dynamic counterpart is Phaser.Physics.Arcade.Group.

Constructor

new StaticGroup(world, scene, [children], [config])

Parameters

nametypeoptionaldescription
worldPhaser.Physics.Arcade.WorldNoThe physics simulation.
scenePhaser.SceneNoThe scene this group belongs to.
childrenArray.<Phaser.GameObjects.GameObject> | Phaser.Types.GameObjects.Group.GroupConfigPhaser.Types.GameObjects.Group.GroupCreateConfigYes
configPhaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfigYesSettings for this group.

Scope: static

Extends

Phaser.GameObjects.Group
Phaser.Physics.Arcade.Components.Collision

Source: src/physics/arcade/StaticPhysicsGroup.js#L15
Since: 3.0.0

Inherited Members

From Phaser.GameObjects.Group:


Public Members

collisionCategory

collisionCategory: number

Description:

The Arcade Physics Static Group Collision Category.

This can be set to any valid collision bitfield value.

See the setCollisionCategory method for more details.

Source: src/physics/arcade/StaticPhysicsGroup.js#L110
Since: 3.70.0


collisionMask

collisionMask: number

Description:

The Arcade Physics Static Group Collision Mask.

See the setCollidesWith method for more details.

Source: src/physics/arcade/StaticPhysicsGroup.js#L123
Since: 3.70.0


physicsType

physicsType: number

Description:

The scene this group belongs to.

Source: src/physics/arcade/StaticPhysicsGroup.js#L100
Since: 3.0.0


type

type: string

Description:

A textual representation of this Game Object.

Used internally by Phaser but is available for your own custom classes to populate.

Overrides: Phaser.GameObjects.Group#type

Source: src/physics/arcade/StaticPhysicsGroup.js#L136
Since: 3.21.0


world

world: Phaser.Physics.Arcade.World

Description:

The physics simulation.

Source: src/physics/arcade/StaticPhysicsGroup.js#L91
Since: 3.0.0


Inherited Methods

From Phaser.Events.EventEmitter:

From Phaser.GameObjects.Group:

From Phaser.Physics.Arcade.Components.Collision:


Public Methods

createCallbackHandler

<instance> createCallbackHandler(child)

Description:

Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation.

Parameters:

nametypeoptionaldescription
childPhaser.GameObjects.GameObjectNoThe new group member.

Source: src/physics/arcade/StaticPhysicsGroup.js#L148
Since: 3.0.0


createMultipleCallbackHandler

<instance> createMultipleCallbackHandler(entries)

Description:

Refreshes the group.

Parameters:

nametypeoptionaldescription
entriesArray.<Phaser.GameObjects.GameObject>NoThe newly created group members.

Source: src/physics/arcade/StaticPhysicsGroup.js#L190
Since: 3.0.0


refresh

<instance> refresh()

Description:

Resets each Body to the position of its parent Game Object.

Body sizes aren't changed (use Phaser.Physics.Arcade.Components.Enable#refreshBody for that).

Returns: Phaser.Physics.Arcade.StaticGroup - This group.

Source: src/physics/arcade/StaticPhysicsGroup.js#L205
Since: 3.0.0


removeCallbackHandler

<instance> removeCallbackHandler(child)

Description:

Disables the group member's physics body, removing it from the simulation.

Parameters:

nametypeoptionaldescription
childPhaser.GameObjects.GameObjectNoThe group member being removed.

Source: src/physics/arcade/StaticPhysicsGroup.js#L172
Since: 3.0.0