phaser - v4.0.0-rc.4
    Preparing search index...
    • Creates a Sprite for every object matching the given tile indexes in the layer. You can optionally specify if each tile will be replaced with a new tile after the Sprite has been created. This is useful if you want to lay down special tiles in a level that are converted to Sprites, but want to replace the tile itself with a floor tile or similar once converted.

      Parameters

      • indexes: number | number[]

        The tile index, or array of indexes, to create Sprites from.

      • replacements: number | number[]

        The tile index, or array of indexes, to change a converted tile to. Set to null to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array.

      • spriteConfig: SpriteConfig

        The config object to pass into the Sprite creator (i.e. scene.make.sprite).

      • scene: Scene

        The Scene to create the Sprites within.

      • camera: Cameras.Scene2D.Camera

        The Camera to use when determining the world XY

      • layer: LayerData

        The Tilemap Layer to act upon.

      Returns GameObjects.Sprite[]