MapFormat

Serializes/deserializes PPE map data in SDLang format. Each layer can contain objects (eg. for marking events, clipping, or sprites if applicable), tilemapping (not for SpriteLayers), embedded data such as tilemapping or scripts, and so on. <br/> Note on layer tags: As of this version, additional tags within layers must have individual names. Subtags within a parent also need to have individual names. Namespaces are reserved for internal use (eg. file sources, objects).

class MapFormat {}

Constructors

this
this(string name, int resX, int resY)

Creates new instance from scratch.

this
this(string source)

Serializes itself from string.

Members

Functions

addEmbeddedMapData
void addEmbeddedMapData(int pri, ubyte[] base64Code)
void addEmbeddedMapData(int pri, MappingElement[] me)

Adds an embedded MapData to a TileLayer.

addEmbeddedPalette
void addEmbeddedPalette(Color[] c, string name, int offset)

Adds an embedded palette to the document.

addMapDataFile
void addMapDataFile(int pri, string filename, string dataPakSrc)

Adds a TileData file to a TileLayer. Filename must contain relative path.

addNewLayer
void addNewLayer(int pri, Tag t, Layer l)

Adds a layer from external tag.

addNewTileLayer
void addNewTileLayer(int pri, int tX, int tY, int mX, int mY, string name, TileLayer l)

Adds a new TileLayer to the document.

addPaletteFile
void addPaletteFile(string filename, string dataPakSrc, int offset)

Adds a palette file source to the document.

addSingleTileInfo
void addSingleTileInfo(int pri, TileInfo item, string source, string dpkSource)

Adds a single TileInfo to a preexisting chunk on the layer.

addSingleTileInfo
void addSingleTileInfo(int pri, Tag t, string source)

Ditto, but from preexiting Tag.

addSubTagToLayersProperty
void addSubTagToLayersProperty(int pri, string name, string parent, T args)

Adds a new subtag to a layer's property tag.

addTagToLayer
void addTagToLayer(int pri, string name, T args)

Adds a new tag to a layer.

addTileInfo
void addTileInfo(int pri, TileInfo[] list, string source, string dpkSource)

Adds TileInfo to a TileLayer. Joins together multiple chunks with the same source identifier. (should be a path)

addTileInfo
void addTileInfo(int pri, Tag t, string source, string dpkSource)

Ditto, but from preexisting Tag.

addTileSourceFile
void addTileSourceFile(int pri, string filename, string dataPakSrc, int offset)

Adds a tile source file to a TileLayer.

editLayerSubtagValues
Value[] editLayerSubtagValues(int pri, string name, string parent, T args)

Edits the values of a layer's subtag. Returns the original values in an array.

editLayerTagValues
Value[] editLayerTagValues(int pri, string name, T args)

Edits the values of a layer's tag. Returns the original values in an array.

getAllTileSources
Tag[] getAllTileSources(int pri)

Returns all tile sources for a given layer. Intended to use with a loader.

getLayerInfo
LayerInfo[] getLayerInfo()

Returns all layer's basic information.

getLayerPropertyTagValues
Value[] getLayerPropertyTagValues(int pri, string name, string parent)

Gets the values of a layer's tag.

getLayerRootTagValues
Value[] getLayerRootTagValues(int pri)

Gets the values of a layer's root tag.

getLayerTagValues
Value[] getLayerTagValues(int pri, string name)

Gets the values of a layer's tag.

getTileInfo
TileInfo[] getTileInfo(int pri)

Returns a selected tile layer's all tile's basic information. Mainly used to display information in editors.

getTileSourceTag
Tag getTileSourceTag(int pri, string filename, string dataPakSrc)

Accesses tile source tags in documents for adding extra data (eg. tile names).

opIndex
Layer opIndex(int index)

Returns the requested layer

pullMapDataFromLayer
void pullMapDataFromLayer(int pri)

Pulls TileLayer data from the layer, and stores it in the preconfigured location. Only works with uncompressed data due to the need of recompression.

removeEmbeddedMapData
Tag removeEmbeddedMapData(int pri)

Removes embedded TileData from a TileLayer. Returns a backup for undoing.

removeLayer
Tag removeLayer(int pri)

Removes a given layer of any kind. Returns the Tag of the layer as a backup.

removeLayerTagValues
Tag removeLayerTagValues(int pri, string name)

Removes a layer's tag. Returns a backup for undoing.

removeMapDataFile
Tag removeMapDataFile(int pri)

Removes a TileData file from a TileLayer. Returns a backup for undoing.

removeTileInfo
Tag removeTileInfo(int pri, string source)

Removes a single tile from a TileInfo chunk. Returns a tag as a backup. Returns null if source is not found.

removeTileSourceFile
Tag removeTileSourceFile(int pri, string filename, string dataPakSrc)

Removes a tile source. Returns a backup copy.

Variables

layerData
Tag[int] layerData;

Layerdata stored as SDLang tags.

layeroutput
Layer[int] layeroutput;

Used to fast map and object data pullback in editors

metadata
Tag metadata;

Stores metadata.

root
Tag root;

Root tag for common information.

tileDataFromExt
TileInfo[][int] tileDataFromExt;

Stores basic TileData that are loaded through extensions

Meta