pugliese Posted August 24, 2015 Share Posted August 24, 2015 Hello, I am new to Phaser and I am testing tilemaps.Any idea why my tilemap loads messed up?- Specially the 32px padding on top, how do I set it to be on x:0, y:0 of the game?code: game = new Phaser.Game(800, 640, Phaser.AUTO, '', { preload: preload, create: create, update: update });game.load.tilemap('map', '/images/game/test.json', null, Phaser.Tilemap.TILED_JSON);game.load.image('tarmac', '/images/game/tarmac.png');game.load.image('192x192', '/images/game/192x192.png');game.physics.startSystem(Phaser.Physics.ARCADE);game.stage.backgroundColor = '#616161';game.map = game.add.tilemap('map', 8, 8);game.map.addTilesetImage('40', 'tarmac', 40, 40);game.map.addTilesetImage('192x192', '192x192', 192, 192);game.layer = game.map.createLayer('Tile Layer 1');tile:http://pastebin.com/rp67xmzqThanksC. jdnichollsc 1 Link to comment Share on other sites More sharing options...
drhayes Posted August 25, 2015 Share Posted August 25, 2015 I'm not sure... but your map species a tile size of 8x8, but your two tile sets at 40x40 and 192x192 (as in the tilewidth and tileheight properties in the map JSON). I'm *fairly* certain that Phaser will just crop the images..? But, from your screenshot, I bet the gray area is pushed down 40px and the blue area is pushed down 192px? Or maybe 32px and 184px? I don't know if that's related to your problem, but it jumped out at me. Link to comment Share on other sites More sharing options...
pugliese Posted August 26, 2015 Author Share Posted August 26, 2015 I was using 8 as tile size, and every tile was a multiple of it, apparently that doesn't work though.Anyway, I fixed it by keeping all tiles with the same size. (odd) Link to comment Share on other sites More sharing options...
Recommended Posts