Phaser API Documentation

  Version: 
overlap(object1, [object2], [overlapCallback], [processCallback], [callbackContext])

Description:

Tests if Game Objects overlap.

See details in Phaser.Physics.Arcade.World#collide.

Parameters:

name type arguments description
object1 Phaser.Types.Physics.Arcade.ArcadeColliderType

The first object or array of objects to check.

object2 Phaser.Types.Physics.Arcade.ArcadeColliderType <optional>

The second object or array of objects to check, or undefined.

overlapCallback ArcadePhysicsCallback <optional>

An optional callback function that is called if the objects overlap.

processCallback ArcadePhysicsCallback <optional>

An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then overlapCallback will only be called if this callback returns true.

callbackContext * <optional>

The context in which to run the callbacks.

Returns:
Description:

True if at least one Game Object overlaps another.

Type:
  • boolean
Examples:
Since: 3.0.0