Thanks all,
Ultimately I draw my tile map as follows:
worldMap[col][row].draw(batch, region);
Where worldMap is a ‘tile’ object whose draw method looks like:
public void draw(Batch batch, TextureRegion[][] t) {
batch.draw(t[2][1], x << 4, y << 4);
}
Full code:
for (int row = sy; row < ey + 1; row++)
for (int col = sx; col < ex + 1; col++)
if (getEntity(col, row) != null)
{
BlankEntity entity = getEntity(col, row);
if (entity instanceof WaterEntity)
batch.setColor(0, 0, 0.4f, 1);
else if (entity.lightUp)
batch.setColor(entity.r, entity.g, entity.b, 1);
else
batch.setColor(0.4f, 0.4f, 0.8f, 1);
worldMap[col][row].draw(batch, region);
}
Thus I draw 64 tiles x 32 tiles in the loop - is this not efficient the way I am calling the batch.draw for each tile? Should I be sending the 64x32 tiles
in one batch.draw method?
Thanks for your help.