Phaser API Documentation

  Version: 
<static> Union(rectA, rectB, [out])

Description:

Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union.

Parameters:

name type arguments description
rectA Phaser.Geom.Rectangle

The first Rectangle to use.

rectB Phaser.Geom.Rectangle

The second Rectangle to use.

out Phaser.Geom.Rectangle <optional>

The Rectangle to store the union in.

Returns:
Description:

The modified out Rectangle, or a new Rectangle if none was provided.

Since: 3.0.0