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
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(TiledParserListener tiledParserListener)
Adds a listener to be notified of parsing results
|
protected TiledObject |
loadObject(com.badlogic.gdx.utils.XmlReader.Element element) |
protected void |
loadObjectGroup(com.badlogic.gdx.utils.XmlReader.Element element) |
protected void |
loadTileLayer(com.badlogic.gdx.utils.XmlReader.Element element) |
void |
notifyBeginParsing(java.lang.String orientation,
java.lang.String staggerAxis,
java.lang.String staggerIndex,
com.badlogic.gdx.graphics.Color backgroundColor,
int width,
int height,
int tileWidth,
int tileHeight,
int sideLength) |
void |
notifyMapPropertyParsed(java.lang.String propertyName,
java.lang.String value) |
void |
notifyObjectGroupParsed(TiledObjectGroup parsedObjectGroup) |
void |
notifyTileLayerParsed(TileLayer parsedLayer) |
void |
notifyTilePropertyParsed(Tile tile) |
void |
notifyTilesetParsed(Tileset parsedTileset) |
void |
parseTmx(com.badlogic.gdx.files.FileHandle tmxFileHandle)
Parses a TMX file and notifies any
TiledParserListener s of
parsing results |
ImageTilesetSource |
parseTsx(com.badlogic.gdx.files.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 void parseTmx(com.badlogic.gdx.files.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(com.badlogic.gdx.files.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 void loadTileLayer(com.badlogic.gdx.utils.XmlReader.Element element)
protected void loadObjectGroup(com.badlogic.gdx.utils.XmlReader.Element element)
protected TiledObject loadObject(com.badlogic.gdx.utils.XmlReader.Element element)
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, com.badlogic.gdx.graphics.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