Rectangle.union()

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

Adds two Rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two Rectangles.

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 new values will be set into this object, otherwise a brand new Rectangle object will be created and returned.

Returns

A Rectangle object that is the union of the two Rectangles.

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

Please login to continue.