In Phaser, I am loading a Tilemap from JSON.
I would like my Tilemap to display in a particular position (for simplicity here I say the middle of the screen).
var map = this.game.add.tilemap('level');
map.addTilesetImage('tiles2', 'tiles2');
var layer = map.createLayer('Ground', map.widthInPixels, map.heightInPixels);
layer.anchor.set(0.5);
//this does not work...
layer.position.set(this.world.centerX, this.world.centerY);
//or even
layer.x = this.world.centerX;
layer.y = this.world.centerY;
The anchor.set
works as it should however setting the position does not seem to work.
What am I doing wrong?