Phaser API Documentation

  Version: 

Member of: Phaser.Actions

<static> ShiftPosition(items, x, y, [direction], [output])

Description:

Iterate through the items array changing the position of each element to be that of the element that came before it in the array (or after it if direction = 1)

The first items position is set to x/y.

The final x/y coords are returned

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.

x number

The x coordinate to place the first item in the array at.

y number

The y coordinate to place the first item in the array at.

direction number <optional>

The iteration direction. 0 = first to last and 1 = last to first.

output object | Phaser.Math.Vector2 <optional>

An optional objec to store the final objects position in.

Returns:
Description:

The output vector.

Examples:
Since: 3.0.0