Phaser API Documentation

  Version: 
<static> GetOverlapX(body1, body2, overlapOnly, bias)

Description:

Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties accordingly, including: touching.left, touching.right, touching.none and `overlapX'.

Parameters:

name type description
body1 Phaser.Physics.Arcade.Body

The first Body to separate.

body2 Phaser.Physics.Arcade.Body

The second Body to separate.

overlapOnly boolean

Is this an overlap only check, or part of separation?

bias number

A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding).

Returns:
Description:

The amount of overlap.

Type:
  • number
Examples:
Since: 3.0.0