Phaser API Documentation

  Version: 

Member of: Phaser.Actions

<static> WrapInRectangle(items, rect, [padding])

Description:

Iterates through the given array and makes sure that each objects x and y properties are wrapped to keep them contained within the given Rectangles area.

Parameters:

name type arguments description
items array | Array.<Phaser.GameObjects.GameObject>

An array of Game Objects. The contents of this array are updated by this Action.

rect Phaser.Geom.Rectangle

The rectangle which the objects will be wrapped to remain within.

padding number <optional>

An amount added to each side of the rectangle during the operation.

Returns:
Description:

The array of Game Objects that was passed to this Action.

Type:
Since: 3.0.0