Hello!
I noticed on the tilemap lib we have the option to draw the grid for development purposes.
I'm trying to build up a function to draw sticky numbers to each tile so during development you can toggle on/off and see what objects you want to map at each tile position, I was able to draw the first x row, however, the tile numbers ( text ) are moving with the player. How can I fix this?
My current function is:
function drawTileNumbers(){
var count = 0;
var x = wade.tilemap.getNumTiles().x;
var y = wade.tilemap.getNumTiles().y;
for (var i = 0; i < x; i++) {
var tileSprite = wade.tilemap.getTileSprite(i, 0).getPosition();
var tileText = new TextSprite(i, '18px Verdana', 'black', 'center');
var tileObj = new SceneObject(tileText, 0, tileSprite.x, tileSprite.y);
wade.addSceneObject(tileObj, true);
}
}
Thanks in advance!