TiledLoader

platypus.components. TiledLoader

new TiledLoader()

This component is attached to a top-level entity and, once its peer components are loaded, ingests a JSON file exported from the Tiled map editor and creates the tile maps and entities. Once it has finished loading the map, it removes itself from the list of components on the entity.

This component requires an EntityContainer since it calls entity.addEntity() on the entity, provided by EntityContainer.

This component looks for the following entities, and if not found will load default versions:

            {
                "render-layer": {
                    "id": "render-layer",
                    "components":[{
                        "type": "RenderTiles",
                        "spriteSheet": "import",
                        "imageMap":    "import",
                        "entityCache": true
                    }]
                },
                "collision-layer": {
                    "id": "collision-layer",
                    "components":[{
                        "type": "CollisionTiles",
                        "collisionMap": "import"
                    }]
                },
                "image-layer": {
                    "id": "image-layer",
                    "components":[{
                        "type": "RenderTiles",
                        "spriteSheet": "import",
                        "imageMap":    "import"
                    }]
                }
            }
Source:
Fires:
Listens to Events: