bigtunacan Posted March 29, 2015 Share Posted March 29, 2015 I'm creating a small map turn based strategy game. The map does not fill the whole screen height so I want to be able to move the map down to center it. Currently it just sets the map layer to have an x,y position of 0,0 so the map starts rendering in the upper left corner and then is obscured by my HUD. I thought I could move the position of the map layer directly by setting the `y` property as I have done in my code below, but this has no affect. map = game.add.tilemap("map", 32, 32, 20, 20);map.addTilesetImage("tiles", "tiles_img");bg_map_layer = map.createLayer("Background");bg_map_layer.y = 200; Link to comment Share on other sites More sharing options...
Akshar Patel Posted April 2, 2015 Share Posted April 2, 2015 Try thisthis.scale.pageAlignVertically = true; // In your Boot or similar filethis.bg_map_layer.resizeWorld(); //after you create a new map layer Link to comment Share on other sites More sharing options...
Recommended Posts