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 class
TmxMapWriter.Format
the encoding oflayer
data -
Field Summary
Fields inherited from class com.badlogic.gdx.utils.XmlWriter
indent
Fields inherited from class java.io.Writer
lock
-
Constructor Summary
Constructors Constructor Description TmxMapWriter(java.io.Writer writer)
creates a newTmxMapWriter
using the givenWriter
-
Method Summary
Modifier and Type Method Description int
getLayerHeight()
void
setLayerHeight(int layerHeight)
TmxMapWriter
tmx(com.badlogic.gdx.maps.MapLayer layer)
TmxMapWriter
tmx(com.badlogic.gdx.maps.MapLayers layers, TmxMapWriter.Format format)
TmxMapWriter
tmx(com.badlogic.gdx.maps.MapObject object)
TmxMapWriter
tmx(com.badlogic.gdx.maps.MapObjects objects)
TmxMapWriter
tmx(com.badlogic.gdx.maps.MapProperties properties)
TmxMapWriter
tmx(com.badlogic.gdx.maps.MapProperties properties, com.badlogic.gdx.utils.Array<java.lang.String> exclude)
writes nothing if the givenMapProperties
are empty or every key is excludedTmxMapWriter
tmx(com.badlogic.gdx.maps.Map map, TmxMapWriter.Format format)
TmxMapWriter
tmx(com.badlogic.gdx.maps.tiled.TiledMapTileLayer layer, TmxMapWriter.Format format)
TmxMapWriter
tmx(com.badlogic.gdx.maps.tiled.TiledMapTileSet set)
TmxMapWriter
tmx(com.badlogic.gdx.maps.tiled.TiledMapTileSets sets)
float
toYDown(float y)
int
toYDown(int y)
Methods inherited from class com.badlogic.gdx.utils.XmlWriter
attribute, close, element, element, flush, pop, text, write
Methods inherited from class java.io.Writer
append, append, append, nullWriter, write, write, write, write
Methods 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 newTmxMapWriter
using the givenWriter
-
-
Method Details
-
tmx
public TmxMapWriter tmx(com.badlogic.gdx.maps.Map map, TmxMapWriter.Format format) throws java.io.IOException- Parameters:
map
- theMap
to write in TMX formatformat
- theTmxMapWriter.Format
to use- Returns:
- this
TmxMapWriter
- Throws:
java.io.IOException
-
tmx
- Parameters:
properties
- theMapProperties
to 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 givenMapProperties
are empty or every key is excluded- Parameters:
properties
- theMapProperties
to 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
- theTiledMapTileSets
to 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
- theTiledMapTileSet
to 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
- theMapLayers
format
- theTmxMapWriter.Format
to use- Returns:
- this
TmxMapWriter
- Throws:
java.io.IOException
-
tmx
- Parameters:
layer
- theMapLayer
to 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
- theTiledMapTileLayer
to write in TMX formatformat
- theTmxMapWriter.Format
to use- Returns:
- this
TmxMapWriter
- Throws:
java.io.IOException
-
tmx
- Parameters:
objects
- theMapObject
to write in TMX format- Returns:
- this
TmxMapWriter
- Throws:
java.io.IOException
-
tmx
- Parameters:
object
- theMapObject
to 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
- thelayerHeight
to set
-