herksaw Posted December 4, 2013 Share Posted December 4, 2013 How do I set the position of tilemapLayer in game world? I have tried the following code but it's not working: var width = map.layers[0].width * tileset.tileWidth;var height = map.layers[0].height * tileset.tileHeight; layer = game.add.tilemapLayer(game.world.centerX - (width / 2), game.world.centerY - (height / 2), width, height, tileset, map, 0); I need to set the position of tilemapLayer to center. shawnbless 1 Link to comment Share on other sites More sharing options...
dchhetri Posted December 6, 2013 Share Posted December 6, 2013 Bumping this as well, hoping someone can answer. Link to comment Share on other sites More sharing options...
herksaw Posted December 6, 2013 Author Share Posted December 6, 2013 I have solved this issue by set the tilemapLayer.fixedToCamera to false, it is true by default. adamsko and qwertxp 2 Link to comment Share on other sites More sharing options...
dchhetri Posted December 7, 2013 Share Posted December 7, 2013 Did it mess-up your collisions? I have multi layer, one for map layer and other for collision Link to comment Share on other sites More sharing options...
herksaw Posted December 7, 2013 Author Share Posted December 7, 2013 No, but it may different since I use custom collision detection instead of the built-in functions provided by Phaser. Link to comment Share on other sites More sharing options...
Recommended Posts