LoadTilemap.c File Reference

Tilemap file loader (.tmx) created with Tiled editor http://www.mapeditor.org. More...

Functions

TLN_Tilemap TLN_LoadTilemap (const char *filename, const char *layername)
 Loads a tilemap layer from a Tiled .tmx file. More...
 

Detailed Description

Tilemap file loader (.tmx) created with Tiled editor http://www.mapeditor.org.

Function Documentation

TLN_Tilemap TLN_LoadTilemap ( const char *  filename,
const char *  layername 
)

Loads a tilemap layer from a Tiled .tmx file.

Parameters
filenameTMX file with the tilemap
layernameOptional name of the layer inside the tmx file to load. NULL to load the first layer
Returns
Reference to the newly loaded tilemap or NULL if error
Remarks
A tmx map file from Tiled can contain one or more layers, each with its own name. TLN_LoadTilemap() doesn't load a full tmx file, only the specified layer. The associated external tileset (TSX file) is also loaded and associated to the tilemap