public class TiledParser extends java.lang.Object implements TiledParserNotifier
TiledParserListener
s of map dataModifier 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
TiledParserListener s 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
TiledParserListener
s 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 TiledImageTilesetSource
java.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.IOException
protected 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.IOException
protected TiledObject loadObject(org.mini2Dx.gdx.xml.XmlReader.Element element, FileHandle tmxFile) throws java.io.IOException
java.io.IOException
public void addListener(TiledParserListener tiledParserListener)
addListener
in interface TiledParserNotifier
tiledParserListener
- The TiledParserListener
to be addedpublic void removeListener(TiledParserListener tiledParserListener)
removeListener
in interface TiledParserNotifier
tiledParserListener
- 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 TiledParserNotifier
public void notifyMapPropertyParsed(java.lang.String propertyName, java.lang.String value)
notifyMapPropertyParsed
in interface TiledParserNotifier
public void notifyTilePropertyParsed(Tile tile)
notifyTilePropertyParsed
in interface TiledParserNotifier
public void notifyTilesetParsed(Tileset parsedTileset)
notifyTilesetParsed
in interface TiledParserNotifier
public void notifyTileLayerParsed(TileLayer parsedLayer)
notifyTileLayerParsed
in interface TiledParserNotifier
public void notifyObjectGroupParsed(TiledObjectGroup parsedObjectGroup)
notifyObjectGroupParsed
in interface TiledParserNotifier
public void notifyGroupLayerParsed(GroupLayer parsedGroupLayer)
notifyGroupLayerParsed
in interface TiledParserNotifier
public void notifyObjectTemplateParsed(TiledObjectTemplate parsedObjectTemplate)
notifyObjectTemplateParsed
in interface TiledParserNotifier