Phaser API Documentation

<static> RandomOutside(outer, inner, [out])


Calculates a random point that lies within the outer Rectangle, but outside of the inner Rectangle. The inner Rectangle must be fully contained within the outer rectangle.


name type arguments description
outer Phaser.Geom.Rectangle

The outer Rectangle to get the random point within.

inner Phaser.Geom.Rectangle

The inner Rectangle to exclude from the returned point.

out Phaser.Geom.Point <optional>

A Point, or Point-like object to store the result in. If not specified, a new Point will be created.


A Point object containing the random values in its x and y properties.

Since: 3.10.0