Scrooler Posted June 14, 2018 Share Posted June 14, 2018 Hello all! I'm make top down game in Phaser 3.9.0 and have a problem. I'm created map in Tiled ver. 0.18.2. and export it in .CSV. It turned out , 5 files = 5 layers. How all of them combine to a mp? My code. function preload () { this.load.image('tiles', 'assets/map/tileset/tilesheet.png'); this.load.tilemapCSV('map', 'assets/map/csv/world_ground.csv'); this.load.tilemapCSV('map', 'assets/map/csv/world_groundvariations.csv'); this.load.tilemapCSV('map', 'assets/map/csv/world_grass.csv'); //and other... } function create () { //MAP map = this.make.tilemap({key : 'map', tileWidth: 32, tileHeight: 32}); var tileset = map.addTilesetImage('tiles'); ground = map.createStaticLayer(0, tileset, 0, 0); grass = map.createStaticLayer(1,tileset,0,0); } Error: Cannot create tilemap layer, invalid layer ID given: 1 This is what is displayed on the screen. Only First Layer Link to comment Share on other sites More sharing options...
cesco_p Posted June 14, 2018 Share Posted June 14, 2018 Try to pass the name of the layer, instead of the ID in the createStaticLayer function grass = map.createStaticLayer('grass',tileset,0,0); Simply pass the name of the layers to this function. It worked out for me Scrooler 1 Link to comment Share on other sites More sharing options...
Recommended Posts