Phaser.Physics.Arcade.Events

Scope: static

Source: src/physics/arcade/events/index.js#L7

Events:

Public Members

COLLIDE

COLLIDE

Description:

The Arcade Physics World Collide Event.

This event is dispatched by an Arcade Physics World instance if two bodies collide and at least one of them has their onCollide property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('collide', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

nametypeoptionaldescription
gameObject1Phaser.GameObjects.GameObjectNoThe first Game Object involved in the collision. This is the parent of body1.
gameObject2Phaser.GameObjects.GameObjectNoThe second Game Object involved in the collision. This is the parent of body2.
body1Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBodyNoThe first Physics Body involved in the collision.
body2Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBodyNoThe second Physics Body involved in the collision.

Source: src/physics/arcade/events/COLLIDE_EVENT.js#L7
Since: 3.0.0


OVERLAP

OVERLAP

Description:

The Arcade Physics World Overlap Event.

This event is dispatched by an Arcade Physics World instance if two bodies overlap and at least one of them has their onOverlap property set to true.

It provides an alternative means to handling overlap events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('overlap', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

nametypeoptionaldescription
gameObject1Phaser.GameObjects.GameObjectNoThe first Game Object involved in the overlap. This is the parent of body1.
gameObject2Phaser.GameObjects.GameObjectNoThe second Game Object involved in the overlap. This is the parent of body2.
body1Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBodyNoThe first Physics Body involved in the overlap.
body2Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBodyNoThe second Physics Body involved in the overlap.

Source: src/physics/arcade/events/OVERLAP_EVENT.js#L7
Since: 3.0.0


PAUSE

PAUSE

Description:

The Arcade Physics World Pause Event.

This event is dispatched by an Arcade Physics World instance when it is paused.

Listen to it from a Scene using: this.physics.world.on('pause', listener).

Source: src/physics/arcade/events/PAUSE_EVENT.js#L7
Since: 3.0.0


RESUME

RESUME

Description:

The Arcade Physics World Resume Event.

This event is dispatched by an Arcade Physics World instance when it resumes from a paused state.

Listen to it from a Scene using: this.physics.world.on('resume', listener).

Source: src/physics/arcade/events/RESUME_EVENT.js#L7
Since: 3.0.0


TILE_COLLIDE

TILE_COLLIDE

Description:

The Arcade Physics Tile Collide Event.

This event is dispatched by an Arcade Physics World instance if a body collides with a Tile and has its onCollide property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('tilecollide', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

nametypeoptionaldescription
gameObjectPhaser.GameObjects.GameObjectNoThe Game Object involved in the collision. This is the parent of body.
tilePhaser.Tilemaps.TileNoThe tile the body collided with.
bodyPhaser.Physics.Arcade.BodyNoThe Arcade Physics Body of the Game Object involved in the collision.

Source: src/physics/arcade/events/TILE_COLLIDE_EVENT.js#L7
Since: 3.16.1


TILE_OVERLAP

TILE_OVERLAP

Description:

The Arcade Physics Tile Overlap Event.

This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile and has its onOverlap property set to true.

It provides an alternative means to handling overlap events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('tileoverlap', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

nametypeoptionaldescription
gameObjectPhaser.GameObjects.GameObjectNoThe Game Object involved in the overlap. This is the parent of body.
tilePhaser.Tilemaps.TileNoThe tile the body overlapped.
bodyPhaser.Physics.Arcade.BodyNoThe Arcade Physics Body of the Game Object involved in the overlap.

Source: src/physics/arcade/events/TILE_OVERLAP_EVENT.js#L7
Since: 3.16.1


WORLD_BOUNDS

WORLD_BOUNDS

Description:

The Arcade Physics World Bounds Event.

This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds and it has its onWorldBounds property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('worldbounds', listener).

Parameters:

nametypeoptionaldescription
bodyPhaser.Physics.Arcade.BodyNoThe Arcade Physics Body that hit the world bounds.
upbooleanNoIs the Body blocked up? I.e. collided with the top of the world bounds.
downbooleanNoIs the Body blocked down? I.e. collided with the bottom of the world bounds.
leftbooleanNoIs the Body blocked left? I.e. collided with the left of the world bounds.
rightbooleanNoIs the Body blocked right? I.e. collided with the right of the world bounds.

Source: src/physics/arcade/events/WORLD_BOUNDS_EVENT.js#L7
Since: 3.0.0


WORLD_STEP

WORLD_STEP

Description:

The Arcade Physics World Step Event.

This event is dispatched by an Arcade Physics World instance whenever a physics step is run. It is emitted after the bodies and colliders have been updated.

In high framerate settings this can be multiple times per game frame.

Listen to it from a Scene using: this.physics.world.on('worldstep', listener).

Parameters:

nametypeoptionaldescription
deltanumberNoThe delta time amount of this step, in seconds.

Source: src/physics/arcade/events/WORLD_STEP_EVENT.js#L7
Since: 3.18.0


Private Members

Updated on