Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds.
The points
parameter is an array of Point-like objects:
const points = [
[100, 200],
[200, 400],
{ x: 30, y: 60 }
]
name | type | arguments | description |
---|---|---|---|
points | array |
An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public |
|
out | Phaser.Geom.Rectangle | <optional> |
Optional Rectangle to adjust. |
The adjusted out
Rectangle, or a new Rectangle if none was provided.