Phaser API Documentation

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

Description:

Tests if Game Objects overlap. See Phaser.Physics.Arcade.World#overlap

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.

collideCallback ArcadePhysicsCallback <optional>

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

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 collideCallback 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
Since: 3.0.0