Currently trying to keep my STI isometric map centered when increase the scale factor but can't quite get the math to check out.
Below is what i am doing to set my camera position (tx / ty);
Code: Select all
-- Calculated each time the scale changes
tx = ((windowWidth - (map.width * map.tilewidth * scale)) / 2);
ty = ((windowHeight - (map.height * map.tileheight * scale)) / 2);
-- love.draw
map:draw(tx, ty, scale, scale);
Any help greatly appreciated.