08-29-2017, 08:29 PM
Yes, layer vs. sprite priority is available but it's a bit undeveloped. Priority is implemented per individual tile and not per full layer: in any given tilemap, you can have some (or all tiles) show in front of sprites. This is accomplished by setting the FLAG_PRIORITY flag in the Tile structure for the desired tiles(s), and the functions TLN_GetTileMapTile() and TLN_SetTilemapTile(). If you want to enable priority on the full tilemap, you could use this helper function:
I'll add a property for Tiled editor loader where you will be able to set tile priority right there.
Code:
void SetTilemapPriority (TLN_Tilemap tilemap)
{
const int num_rows = TLN_GetTilemapRows (tilemap);
const int num_cols = TLN_GetTilemapCols (tilemap);
int row, col;
for (row=0; row<num_rows; row++)
{
for (col=0; col<num_cols; col++)
{
Tile tile;
TLN_GetTilemapTile (tilemap, row, col, &tile);
tile.flags |= FLAG_PRIORITY;
TLN_SetTilemapTile (tilemap, row, col, &tile);
}
}
}
I'll add a property for Tiled editor loader where you will be able to set tile priority right there.