Phaser API Documentation

  Version: 

Member of: Phaser.Actions

<static> AlignTo(items, position, [offsetX], [offsetY])

Description:

Takes an array of Game Objects, or any objects that have public x and y properties, and aligns them next to each other.

The first item isn't moved. The second item is aligned next to the first, then the third next to the second, and so on.

Parameters:

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

The array of items to be updated by this action.

position number

The position to align the items with. This is an align constant, such as Phaser.Display.Align.LEFT_CENTER.

offsetX number <optional>

Optional horizontal offset from the position.

offsetY number <optional>

Optional vertical offset from the position.

Returns:
Description:

The array of objects that were passed to this Action.

Type:
Since: 3.22.0
Source: src/actions/AlignTo.js (Line 9)