Phaser API Documentation

  Version: 
<static> RectangleToRectangle(rectA, rectB)

Description:

Checks if two Rectangles intersect.

A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle.

Parameters:

name type description
rectA Phaser.Geom.Rectangle

The first Rectangle to check for intersection.

rectB Phaser.Geom.Rectangle

The second Rectangle to check for intersection.

Returns:
Description:

true if the two Rectangles intersect, otherwise false.

Type:
  • boolean
Examples:
Since: 3.0.0