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)
Please login to continue.