flippy Posted September 7, 2015 Share Posted September 7, 2015 hi, so im having a problem when trying to use a json this is my code function preload(){game.load.tilemap('tilestest','Assets/tilestestmap.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles','Assets/tilestestmap.png');}function create() {//creating the mapmap = game.add.tilemap('tilestest');map.addTilesetImage('tiles');layer = map.createLayer('tiles1')layer2 = map.createLayer('objects');layer3 = map.createLayer('extracollision');layer4 = map.createLayer('collisionlayer');layer.resizeWorld(); layer.wrap = true;} the layer names as i know are the names of the layers inside tiled , so that is "tiles1,objects,extracollision,collision"and i cant figure out what the problem is , console tells me its "Phaser.Tileset - image tile area is not an even multiple of tile size"and it appears twice for some reason :Splease help :c Link to comment Share on other sites More sharing options...
bobonthenet Posted September 9, 2015 Share Posted September 9, 2015 I am having the same issue. Have you been able to figure this out? Here is the github repo of my project as of this posting I have everything commented out that isn't involved with displaying the map. https://github.com/bobonthenet/knightfight I'm hoping I'm missing something obvious to a non-novice. Link to comment Share on other sites More sharing options...
CodeToWin Posted September 9, 2015 Share Posted September 9, 2015 it sounds like there is a mismatch between the size of your map in Tiled and the size of your individual tiles. What is the width and height of your tiles, and what is the width/height of your map? Link to comment Share on other sites More sharing options...
bobonthenet Posted September 9, 2015 Share Posted September 9, 2015 it sounds like there is a mismatch between the size of your map in Tiled and the size of your individual tiles. What is the width and height of your tiles, and what is the width/height of your map?The height/width of the map is 10x100 tiles and the size of the tiles is 8x8px. Do I need to somehow specify that the map size unit is tiles and the tile size is in pixels? I've been shifting things around on the map and now I'm getting an error "Uncaught TypeError: Cannot read property 'style' of null" I'm not sure that is related to the original issue though. I might make a new post. Link to comment Share on other sites More sharing options...
CodeToWin Posted September 9, 2015 Share Posted September 9, 2015 when you make a new map in Tiled, it asks you for the tile size. Make sure it's set to 8 x 8 Link to comment Share on other sites More sharing options...
bobonthenet Posted September 10, 2015 Share Posted September 10, 2015 when you make a new map in Tiled, it asks you for the tile size. Make sure it's set to 8 x 8I recreated the map so that I could be absolutely sure that the tile size is set correctly and I am still getting the same error. Link to comment Share on other sites More sharing options...
Recommended Posts