Phaser API Documentation

  Version: 
<static> FitOutside(target, source)

Description:

Adjusts the target rectangle, changing its width, height and position, so that it fully covers the area of the source rectangle, while maintaining its original aspect ratio.

Unlike the FitInside function, the target rectangle may extend further out than the source.

Parameters:

name type description
target Phaser.Geom.Rectangle

The target rectangle to adjust.

source Phaser.Geom.Rectangle

The source rectangle to envelope the target in.

Returns:
Description:

The modified target rectangle instance.

Since: 3.0.0