Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Polygon

<static> GetAABB(polygon, [out])

Description:

Calculates the bounding AABB rectangle of a polygon.

Parameters:

name type arguments description
polygon Phaser.Geom.Polygon

The polygon that should be calculated.

out object | Phaser.Geom.Rectangle <optional>

The rectangle or object that has x, y, width, and height properties to store the result. Optional.

Returns:
Description:

The resulting rectangle or object that is passed in with position and dimensions of the polygon's AABB.

Type:
Since: 3.0.0