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:
Closeable,Flushable,Appendable,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 -
Field Summary
Fields inherited from class com.badlogic.gdx.utils.XmlWriter
indent -
Constructor Summary
ConstructorsConstructorDescriptionTmxMapWriter(Writer writer) creates a newTmxMapWriterusing the givenWriter -
Method Summary
Modifier and TypeMethodDescriptionintvoidsetLayerHeight(int layerHeight) tmx(com.badlogic.gdx.maps.MapLayer layer) tmx(com.badlogic.gdx.maps.MapLayers layers, TmxMapWriter.Format format) tmx(com.badlogic.gdx.maps.MapObject object) tmx(com.badlogic.gdx.maps.MapObjects objects) tmx(com.badlogic.gdx.maps.MapProperties properties) writes nothing if the givenMapPropertiesare empty or every key is excludedtmx(com.badlogic.gdx.maps.Map map, TmxMapWriter.Format format) tmx(com.badlogic.gdx.maps.tiled.TiledMapTileLayer layer, TmxMapWriter.Format format) tmx(com.badlogic.gdx.maps.tiled.TiledMapTileSet set) tmx(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, write
-
Constructor Details
-
TmxMapWriter
creates a newTmxMapWriterusing the givenWriter
-
-
Method Details
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.Map map, TmxMapWriter.Format format) throws IOException - Parameters:
map- theMapto write in TMX formatformat- theTmxMapWriter.Formatto use- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
- Parameters:
properties- theMapPropertiesto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.MapProperties properties, com.badlogic.gdx.utils.Array<String> exclude) throws IOException writes 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:
IOException
-
tmx
- Parameters:
sets- theTiledMapTileSetsto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
- Parameters:
set- theTiledMapTileSetto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.MapLayers layers, TmxMapWriter.Format format) throws IOException - Parameters:
layers- theMapLayersformat- theTmxMapWriter.Formatto use- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
- Parameters:
layer- theMapLayerto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.tiled.TiledMapTileLayer layer, TmxMapWriter.Format format) throws IOException - Parameters:
layer- theTiledMapTileLayerto write in TMX formatformat- theTmxMapWriter.Formatto use- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
- Parameters:
objects- theMapObjectto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
IOException
-
tmx
- Parameters:
object- theMapObjectto write in TMX format- Returns:
- this
TmxMapWriter - Throws:
IOException
-
toYDown
public int toYDown(int y) - See Also:
-
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
-