I know this is a vague question but still I am asking it : how exactly is tilemap handling done in SFML and C++ using Tiled!
Can anyone please explain briefly to me the exact methods and algorithms used for loading and displaying tilemaps?
Thanks
For starters, you could just open a .tmx file and take a look yourself: Tiled saves maps as xml encoded strings of tile IDs (most commonly in cvs[comma separated values] form), where I believe 0 corresponds to "no tile" and from thereon tile ID 1 is the most top left tile in the tileset. The IDs cound up like you would read text, ie.
1, 2, 3, 4, 5, 6
7, 8, 9, 10, 11, 12 [etc]
so to map an ID to a tile, you have to do something like
int _id = id-1;
int tileX = (_id % mapWidth)*tileWidth; // 'mapWidth' in tiles, 'tileWidth/Height' in pixels
int tileY = (_id / mapWidth)*tileHeight;
and that's your pixel coordinates into the tileset.
Also note that Tiled supports multiple layers drawn on top of each other, so you will want to parse each layer separately.