readLDtkMapLoader

suspend fun VfsFile.readLDtkMapLoader(atlas: TextureAtlas? = null, tilesetBorder: Int = 2): LDtkMapLoader

Reads the VfsFile as a LDtkMapLoader. This will read the LDtk file and create a loader to allow flexible loading of LDtkWorld or LDtkLevel. This loader should be cached and reused when loading separate levels.

Return

the loaded LDtk map

Parameters

atlas

an atlas the has the preloaded textures for both tilesets and image layers. Note: that if the Texture for a tileset has a border thickness set, that value must be used for tilesetBorder. If no border is set, then tilesetBorder must be marked as 0.

tilesetBorder

the border thickness of each slice when loading the tileset to prevent bleeding. This is used when slicing tileset textures from an atlas or when loading externally.