I am making turn based strategy based on a tiled map. My map contains two layers - first one is visible all the time and is used as a background, the second one is used for highlighting the tiles. Highlighted tiles shows possible movement for the player. For now the progress looks like this:
To make a highlighting possible I use this for loop:
for(int s = 0;s<7;){
for (int i = 0;i<7;i++) {
if ((inField(clickx + i,clicky + s)) && !(tileWithPlayer(clickx + i,clicky + s)))
{
highlight_layer.getCell(clickx + i, clicky+s).setTile(mark);
}
}
s++;
}
In this I use one tile from second layer of the map to make a border for a specific tiles. For now this tile is only 2px border of 32x32 transparent tile. To make highlighting disappear, I use similar for loop, where I set the tile to null. Selecting/deselecting tiles works great, but it is probably not the most efficient way to do this. I would like to exchange the blue border boxes into colored transparent boxes, something like in Advance wars during the movement, or as it can be seen below:
I tried to make a semi transparent tile on the second layer in tiled, but without luck. It could be nice if there is some possibility to apply only semi-transparent color on the specific tiles, without using the second layer tile. So, my question is - how can I exchange those ugly borders, into fully colored, (semi)transparent tiles, to achieve similar result as in above picture?