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,
com.badlogic.gdx.graphics.Color backgroundColor,
int width,
int height,
int tileWidth,
int tileHeight)
Notify all
TiledParserListener s that parsing has begun |
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 |
parse(com.badlogic.gdx.files.FileHandle tmxFileHandle)
Parses a TMX file and notifies any
TiledParserListener s of
parsing results |
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 parse(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 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, com.badlogic.gdx.graphics.Color backgroundColor, int width, int height, int tileWidth, int tileHeight)
TiledParserNotifier
TiledParserListener
s that parsing has begunnotifyBeginParsing
in interface TiledParserNotifier
orientation
- The map orientationbackgroundColor
- The map background colorpublic 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