Phaser API Documentation

  Version: 
imageStack(key, frame, x, y, columns, rows, [columnGap], [rowGap], [options])

Description:

Create a new composite containing Matter Image objects created in a grid arrangement. This function uses the body bounds to prevent overlaps.

Parameters:

name type arguments description
key string

The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.

frame string | number

An optional frame from the Texture this Game Object is rendering with. Set to null to skip this value.

x number

The horizontal position of this composite in the world.

y number

The vertical position of this composite in the world.

columns number

The number of columns in the grid.

rows number

The number of rows in the grid.

columnGap number <optional>

The distance between each column.

rowGap number <optional>

The distance between each row.

options Phaser.Types.Physics.Matter.MatterBodyConfig <optional>

An optional Body configuration object that is used to set initial Body properties on creation.

Returns:
Description:

A Matter JS Composite Stack.

Type:
  • MatterJS.CompositeType
Since: 3.0.0