Rectangle#intersection()

intersection(b, out) → {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 Description
b Phaser.Rectangle

The second Rectangle object.

out Phaser.Rectangle

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 310)
doc_phaser
2017-02-14 11:06:58
Comments
Leave a Comment

Please login to continue.