Jump to content

Positioning a tilemap?


Recommended Posts

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


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...