Phaser API Documentation

<static> Intersection(rectA, rectB, [out])


Takes two Rectangles and first checks to see if they intersect. If they intersect it will return the area of intersection in the out Rectangle. If they do not intersect, the out Rectangle will have a width and height of zero.


name type arguments description
rectA Phaser.Geom.Rectangle

The first Rectangle to get the intersection from.

rectB Phaser.Geom.Rectangle

The second Rectangle to get the intersection from.

out Phaser.Geom.Rectangle <optional>

A Rectangle to store the intersection results in.


The intersection result. If the width and height are zero, no intersection occurred.

Since: 3.11.0