Rectangle.intersection()

<static> intersection(a, b, output) → {Phaser.Rectangle}

If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the Rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0.

Parameters
Name Type Argument Description
a Phaser.Rectangle

The first Rectangle object.

b Phaser.Rectangle

The second Rectangle object.

output Phaser.Rectangle <optional>

Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned.

Returns

A Rectangle object that equals the area of intersection. If the Rectangles do not intersect, this method returns an empty Rectangle object; that is, a Rectangle with its x, y, width, and height properties set to 0.

Source code: geom/Rectangle.js (Line 933)
doc_phaser
2017-02-14 11:07:14
Comments
Leave a Comment

Please login to continue.