Package net.dermetfan.gdx.maps.tiled
Class TmxMapWriter
java.lang.Object
java.io.Writer
com.badlogic.gdx.utils.XmlWriter
net.dermetfan.gdx.maps.tiled.TmxMapWriter
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable
public class TmxMapWriter
extends com.badlogic.gdx.utils.XmlWriter
A
XmlWriter with additional tmx(..) methods.
Note: Not available in GWT.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTmxMapWriter.Formatthe encoding oflayerdata -
Field Summary
Fields inherited from class com.badlogic.gdx.utils.XmlWriter
indentFields inherited from class java.io.Writer
lock -
Constructor Summary
Constructors Constructor Description TmxMapWriter(java.io.Writer writer)creates a newTmxMapWriterusing the givenWriter -
Method Summary
Modifier and Type Method Description intgetLayerHeight()voidsetLayerHeight(int layerHeight)TmxMapWritertmx(com.badlogic.gdx.maps.MapLayer layer)TmxMapWritertmx(com.badlogic.gdx.maps.MapLayers layers, TmxMapWriter.Format format)TmxMapWritertmx(com.badlogic.gdx.maps.MapObject object)TmxMapWritertmx(com.badlogic.gdx.maps.MapObjects objects)TmxMapWritertmx(com.badlogic.gdx.maps.MapProperties properties)TmxMapWritertmx(com.badlogic.gdx.maps.MapProperties properties, com.badlogic.gdx.utils.Array<java.lang.String> exclude)writes nothing if the givenMapPropertiesare empty or every key is excludedTmxMapWritertmx(com.badlogic.gdx.maps.Map map, TmxMapWriter.Format format)TmxMapWritertmx(com.badlogic.gdx.maps.tiled.TiledMapTileLayer layer, TmxMapWriter.Format format)TmxMapWritertmx(com.badlogic.gdx.maps.tiled.TiledMapTileSet set)TmxMapWritertmx(com.badlogic.gdx.maps.tiled.TiledMapTileSets sets)floattoYDown(float y)inttoYDown(int y)Methods inherited from class com.badlogic.gdx.utils.XmlWriter
attribute, close, element, element, flush, pop, text, writeMethods inherited from class java.io.Writer
append, append, append, nullWriter, write, write, write, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TmxMapWriter
public TmxMapWriter(java.io.Writer writer)creates a newTmxMapWriterusing the givenWriter
-
-
Method Details
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.Map map, TmxMapWriter.Format format) throws java.io.IOException- Parameters:
map- theMapto write in TMX formatformat- theTmxMapWriter.Formatto use- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
- Parameters:
properties- theMapPropertiesto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.MapProperties properties, com.badlogic.gdx.utils.Array<java.lang.String> exclude) throws java.io.IOExceptionwrites nothing if the givenMapPropertiesare empty or every key is excluded- Parameters:
properties- theMapPropertiesto write in TMX formatexclude- the keys not to write- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.tiled.TiledMapTileSets sets) throws java.io.IOException- Parameters:
sets- theTiledMapTileSetsto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.tiled.TiledMapTileSet set) throws java.io.IOException- Parameters:
set- theTiledMapTileSetto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.MapLayers layers, TmxMapWriter.Format format) throws java.io.IOException- Parameters:
layers- theMapLayersformat- theTmxMapWriter.Formatto use- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
- Parameters:
layer- theMapLayerto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.tiled.TiledMapTileLayer layer, TmxMapWriter.Format format) throws java.io.IOException- Parameters:
layer- theTiledMapTileLayerto write in TMX formatformat- theTmxMapWriter.Formatto use- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
- Parameters:
objects- theMapObjectto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
tmx
- Parameters:
object- theMapObjectto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
java.io.IOException
-
toYDown
public int toYDown(int y)- See Also:
toYDown(float)
-
toYDown
public float toYDown(float y)- Parameters:
y- the y coordinate- Returns:
- the y coordinate converted from a y-up to a y-down coordinate system
-
getLayerHeight
public int getLayerHeight()- Returns:
- the
layerHeight
-
setLayerHeight
public void setLayerHeight(int layerHeight)- Parameters:
layerHeight- thelayerHeightto set
-