Phaser API Documentation

  Version: 
<private> collideSpriteVsSprite(sprite1, sprite2, [collideCallback], [processCallback], [callbackContext], overlapOnly)

Description:

Internal handler for Sprite vs. Sprite collisions. Please use Phaser.Physics.Arcade.World#collide instead.

Parameters:

name type arguments description
sprite1 Phaser.GameObjects.GameObject

The first object to check for collision.

sprite2 Phaser.GameObjects.GameObject

The second object to check for collision.

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 collide. If this is set then collideCallback will only be called if this callback returns true.

callbackContext any <optional>

The context in which to run the callbacks.

overlapOnly boolean

Whether this is a collision or overlap check.

Returns:
Description:

True if any objects overlap (with overlapOnly); or true if any overlapping objects were separated.

Type:
  • boolean
Examples:
Since: 3.0.0