public class TiledParser extends java.lang.Object implements TiledParserNotifier
TiledParserListeners of map data| Modifier and Type | Field and Description |
|---|---|
protected static int |
FLAG_FLIP_DIAGONALLY |
protected static int |
FLAG_FLIP_HORIZONTALLY |
protected static int |
FLAG_FLIP_VERTICALLY |
protected static int |
MASK_CLEAR |
| Constructor and Description |
|---|
TiledParser()
Constructor
|
TiledParser(org.mini2Dx.gdx.utils.ObjectMap<java.lang.String,TiledObjectTemplate> objectTemplates) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TiledParserListener tiledParserListener)
Adds a listener to be notified of parsing results
|
protected GroupLayer |
loadGroupLayer(org.mini2Dx.gdx.xml.XmlReader.Element layerElement,
FileHandle tmxFileHandle) |
protected TiledObject |
loadObject(org.mini2Dx.gdx.xml.XmlReader.Element element,
FileHandle tmxFile) |
protected TiledObjectGroup |
loadObjectGroup(org.mini2Dx.gdx.xml.XmlReader.Element element,
FileHandle tmxFile) |
protected TileLayer |
loadTileLayer(org.mini2Dx.gdx.xml.XmlReader.Element element) |
void |
notifyBeginParsing(java.lang.String orientation,
java.lang.String staggerAxis,
java.lang.String staggerIndex,
Color backgroundColor,
int width,
int height,
int tileWidth,
int tileHeight,
int sideLength) |
void |
notifyGroupLayerParsed(GroupLayer parsedGroupLayer) |
void |
notifyMapPropertyParsed(java.lang.String propertyName,
java.lang.String value) |
void |
notifyObjectGroupParsed(TiledObjectGroup parsedObjectGroup) |
void |
notifyObjectTemplateParsed(TiledObjectTemplate parsedObjectTemplate) |
void |
notifyTileLayerParsed(TileLayer parsedLayer) |
void |
notifyTilePropertyParsed(Tile tile) |
void |
notifyTilesetParsed(Tileset parsedTileset) |
void |
parseTmx(FileHandle tmxFileHandle)
Parses a TMX file and notifies any
TiledParserListeners of
parsing results |
ImageTilesetSource |
parseTsx(FileHandle tsxFileHandle)
Parses a TSX file
|
void |
removeListener(TiledParserListener tiledParserListener)
Removes a listener from being notified of parsing results
|
protected static final int FLAG_FLIP_HORIZONTALLY
protected static final int FLAG_FLIP_VERTICALLY
protected static final int FLAG_FLIP_DIAGONALLY
protected static final int MASK_CLEAR
public TiledParser()
public TiledParser(org.mini2Dx.gdx.utils.ObjectMap<java.lang.String,TiledObjectTemplate> objectTemplates)
public void parseTmx(FileHandle tmxFileHandle) throws java.io.IOException
TiledParserListeners of
parsing resultstmxFileHandle - A FileHandle to a TMX file exported from Tiledjava.io.IOException - Thrown if the map file could not be parsedpublic ImageTilesetSource parseTsx(FileHandle tsxFileHandle) throws java.io.IOException
tsxFileHandle - A FileHandle to a TSX file exported from TiledImageTilesetSourcejava.io.IOException - Thrown if the tileset file could not be parsedprotected GroupLayer loadGroupLayer(org.mini2Dx.gdx.xml.XmlReader.Element layerElement, FileHandle tmxFileHandle) throws java.io.IOException
java.io.IOExceptionprotected TileLayer loadTileLayer(org.mini2Dx.gdx.xml.XmlReader.Element element)
protected TiledObjectGroup loadObjectGroup(org.mini2Dx.gdx.xml.XmlReader.Element element, FileHandle tmxFile) throws java.io.IOException
java.io.IOExceptionprotected TiledObject loadObject(org.mini2Dx.gdx.xml.XmlReader.Element element, FileHandle tmxFile) throws java.io.IOException
java.io.IOExceptionpublic void addListener(TiledParserListener tiledParserListener)
addListener in interface TiledParserNotifiertiledParserListener - The TiledParserListener to be addedpublic void removeListener(TiledParserListener tiledParserListener)
removeListener in interface TiledParserNotifiertiledParserListener - The TiledParserListener to be removedpublic void notifyBeginParsing(java.lang.String orientation,
java.lang.String staggerAxis,
java.lang.String staggerIndex,
Color backgroundColor,
int width,
int height,
int tileWidth,
int tileHeight,
int sideLength)
notifyBeginParsing in interface TiledParserNotifierpublic void notifyMapPropertyParsed(java.lang.String propertyName,
java.lang.String value)
notifyMapPropertyParsed in interface TiledParserNotifierpublic void notifyTilePropertyParsed(Tile tile)
notifyTilePropertyParsed in interface TiledParserNotifierpublic void notifyTilesetParsed(Tileset parsedTileset)
notifyTilesetParsed in interface TiledParserNotifierpublic void notifyTileLayerParsed(TileLayer parsedLayer)
notifyTileLayerParsed in interface TiledParserNotifierpublic void notifyObjectGroupParsed(TiledObjectGroup parsedObjectGroup)
notifyObjectGroupParsed in interface TiledParserNotifierpublic void notifyGroupLayerParsed(GroupLayer parsedGroupLayer)
notifyGroupLayerParsed in interface TiledParserNotifierpublic void notifyObjectTemplateParsed(TiledObjectTemplate parsedObjectTemplate)
notifyObjectTemplateParsed in interface TiledParserNotifier