locohost Posted October 3, 2014 Share Posted October 3, 2014 Hello, thanks for helping with this. I'm completely new to Phaser. I've been reading tutorials and searching for an answer as to why my tilemap tiles are scaling up incredibly huge. This is a screen clip of a corner of the tileset in the Tiled editor... Here is how it renders in Phaser game using latest Chrome in Win7... Here is the code I'm using from a tutorial... create: function () { this.scale.scaleMode = Phaser.ScaleManager.RESIZE; map = game.add.tilemap('map'); // Preloaded tilemap map.addTilesetImage('OfficeWalls', 'tileset'); // Preloaded tileset layer = map.createLayer('Tile Layer 1'); // This is the default name of the first layer in Tiled layer.resizeWorld(); // Sets the world size to match the size of this layer. layer.debug = true; map.setCollisionBetween(0, 100); cursors = game.input.keyboard.createCursorKeys(); },Can you tell me what I'm doing wrong? I'd greatly appreciate any expert advice :-) Mark Link to comment Share on other sites More sharing options...
j0hnskot Posted October 3, 2014 Share Posted October 3, 2014 It seems that there is an error on loading the tileset image (the green lines indicate that no texture is used).There should be an error or warning in the console (For chrome ctrl+alt+J) mentioning a problem with loading. What does it say? Can you also show us the section of the preload function where you preload the tileset? Link to comment Share on other sites More sharing options...
locohost Posted October 3, 2014 Author Share Posted October 3, 2014 @j0hnskot: Thanks for replying! Within an hour or so after posting, I worked it out. Of course The large green "wall" outline shapes are the layer.debug lines around my actual walls. My walls are black and the default background (here was my stupidity) is also black. So the map was rendering just fine, but it was black on black then showing the debug green borders. I didn't know what the green debug borders were so I was very puzzled by the display. I added a light gray background color and then, amazing, the map looks right Thank you again @j0hnskot Link to comment Share on other sites More sharing options...
Recommended Posts