Skip to content
Minh Ngo edited this page Jun 18, 2013 · 7 revisions

The loader module is for saving and loading maps/atlases/drawlists. It uses love.filesystem for saving and loading files. Only strings, booleans, and numbers are saved for custom properties. If a property is a table, the limitation applies to the keys and values.


loader.saveAtlas(atlas,path)

Saves the atlas to the specified path and filename. Returns true if successful, else it returns a second value with the error message.


loader.loadAtlas(path)

Loads the atlas from the specified path and filename. If there was an error, return nothing and the error message.


loader.saveMap(map,path)

Saves the map to the specified path and filename. It also saves the atlas; the name can be optionally set with atlas:setName; the atlas is saved as atlas:getName()..'.atlas'. map:setImageSource must also be used so the loader can find the image when loading a map. The function returns true if the map is saved, else it returns a second value with the error message.


loader.loadMap(path)

Loads the map from the specified path and filename. If there was an error, return nothing and the error message.


loader.saveDrawList(drawlist,path)

Saves the drawlist to the specified path and filename. It also saves each map layer and atlas; non-map layers are saved as placeholders. The name of a map can be optionally set with map:setName; the map is saved as map:getName()..'.map' The function returns true if the drawlist is saved, else it returns a second value with the error message.


loader.loadDrawList(path)

Loads the drawlist from the specified path and filename. If there was an error, return nothing and the error message.

Clone this wiki locally