Phaser API Documentation

  Version: 
<static> FromXY(x1, y1, x2, y2, [out])

Description:

Create the smallest Rectangle containing two coordinate pairs.

Parameters:

name type arguments description
x1 number

The X coordinate of the first point.

y1 number

The Y coordinate of the first point.

x2 number

The X coordinate of the second point.

y2 number

The Y coordinate of the second point.

out Phaser.Geom.Rectangle <optional>

Optional Rectangle to adjust.

Returns:
Description:

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

Since: 3.23.0