new TilemapLayer(game, tilemap, index, width, height)
A TilemapLayer is a Phaser.Image/Sprite that renders a specific TileLayer of a Tilemap.
Since a TilemapLayer is a Sprite it can be moved around the display, added to other groups or display objects, etc.
By default TilemapLayers have fixedToCamera set to true. Changing this will break Camera follow and scrolling behavior.
Parameters
| Name | Type | Description |
|---|---|---|
game | Phaser.Game | Game reference to the currently running game. |
tilemap | Phaser.Tilemap | The tilemap to which this layer belongs. |
index | integer | The index of the TileLayer to render within the Tilemap. |
width | integer | Width of the renderable area of the layer (in pixels). |
height | integer | Height of the renderable area of the layer (in pixels). |
- Source code: tilemap/TilemapLayer.js (Line 23)
Please login to continue.