java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
de.gurkenlabs.litiengine.environment.tilemap.xml.TmxMap
All Implemented Interfaces:
ICustomPropertyProvider, ILayerList, IMap, Comparable<IMap>

public final class TmxMap extends CustomPropertyProvider implements IMap
  • Field Details

  • Constructor Details

    • TmxMap

      public TmxMap()
    • TmxMap

      public TmxMap(IMapOrientation orientation)
  • Method Details

    • getImageLayers

      public List<IImageLayer> getImageLayers()
      Description copied from interface: ILayerList
      Gets the IImageLayers contained in a Layer list.
      Specified by:
      getImageLayers in interface ILayerList
      Returns:
      a List of all IImageLayers
    • getNextObjectId

      public int getNextObjectId()
      Gets the next object id.
      Specified by:
      getNextObjectId in interface IMap
      Returns:
      the next object id
    • getNextLayerId

      public int getNextLayerId()
      Specified by:
      getNextLayerId in interface IMap
    • getOrientation

      public IMapOrientation getOrientation()
      Description copied from interface: IMap
      Gets the orientation.
      Specified by:
      getOrientation in interface IMap
      Returns:
      the orientation
    • setOrientation

      public void setOrientation(IMapOrientation orientation)
    • getPath

      public URL getPath()
      Specified by:
      getPath in interface IMap
    • setPath

      public void setPath(URL path)
    • getRenderOrder

      public RenderOrder getRenderOrder()
      Description copied from interface: IMap
      Gets the renderorder.
      Specified by:
      getRenderOrder in interface IMap
      Returns:
      the renderorder
    • setRenderOrder

      public void setRenderOrder(RenderOrder renderorder)
    • getMapObjectLayers

      public List<IMapObjectLayer> getMapObjectLayers()
      Description copied from interface: ILayerList
      Gets all MapObjectLayers in the Layer list.
      Specified by:
      getMapObjectLayers in interface ILayerList
      Returns:
      a List of IMapObjectLayers
    • getSizeInPixels

      public Dimension getSizeInPixels()
      Description copied from interface: IMap
      Gets the size in pixels.
      Specified by:
      getSizeInPixels in interface IMap
      Returns:
      the size in pixels
    • getBounds

      public Rectangle2D getBounds()
      Specified by:
      getBounds in interface IMap
    • getSizeInTiles

      public Dimension getSizeInTiles()
      Description copied from interface: IMap
      Gets the sizein tiles.
      Specified by:
      getSizeInTiles in interface IMap
      Returns:
      the sizein tiles
    • getTileLayers

      public List<ITileLayer> getTileLayers()
      Description copied from interface: ILayerList
      Gets the ITileLayers contained in a Layer list.
      Specified by:
      getTileLayers in interface ILayerList
      Returns:
      a List of all ITileLayers
    • getTilesets

      public List<ITileset> getTilesets()
      Description copied from interface: IMap
      Gets the tilesets.
      Specified by:
      getTilesets in interface IMap
      Returns:
      the tilesets
    • getTilesetEntry

      public ITilesetEntry getTilesetEntry(int gid)
      Specified by:
      getTilesetEntry in interface IMap
    • getTileSize

      public Dimension getTileSize()
      Description copied from interface: IMap
      Gets the tile size.
      Specified by:
      getTileSize in interface IMap
      Returns:
      the tile size
    • getParallaxOrigin

      public Point2D getParallaxOrigin()
      Description copied from interface: IMap
      Gets the coordinates of the parallax origin in pixels.
      Specified by:
      getParallaxOrigin in interface IMap
      Returns:
      The parallax origin.
    • getTileWidth

      public int getTileWidth()
      Description copied from interface: IMap
      Gets the horizontal tile size.
      Specified by:
      getTileWidth in interface IMap
      Returns:
      the horizontal tile size
    • setTileWidth

      public void setTileWidth(int tilewidth)
    • getTileHeight

      public int getTileHeight()
      Description copied from interface: IMap
      Gets the vertical tile size.
      Specified by:
      getTileHeight in interface IMap
      Returns:
      the vertical tile size
    • setTileHeight

      public void setTileHeight(int tileheight)
    • getVersion

      public double getVersion()
      Description copied from interface: IMap
      Gets the version.
      Specified by:
      getVersion in interface IMap
      Returns:
      the version
    • setVersion

      public void setVersion(double version)
    • getTiledVersion

      public String getTiledVersion()
      Specified by:
      getTiledVersion in interface IMap
    • setTiledVersion

      public void setTiledVersion(String tiledversion)
    • getGroupLayers

      public List<IGroupLayer> getGroupLayers()
      Description copied from interface: ILayerList
      Gets the IGroupLayers contained in a Layer list.
      Specified by:
      getGroupLayers in interface ILayerList
      Returns:
      a List of all IGroupLayers
    • getName

      public String getName()
      Specified by:
      getName in interface IMap
    • setName

      public void setName(String name)
      Description copied from interface: IMap
      Sets the name.
      Specified by:
      setName in interface IMap
      Parameters:
      name - the new name
    • getWidth

      public int getWidth()
      Description copied from interface: IMap
      Gets the map width in tiles.
      Specified by:
      getWidth in interface IMap
      Returns:
      the width in tiles
    • setWidth

      public void setWidth(int width)
    • getHeight

      public int getHeight()
      Description copied from interface: IMap
      Gets the map height in tiles.
      Specified by:
      getHeight in interface IMap
      Returns:
      the height in tiles
    • setHeight

      public void setHeight(int height)
    • getHexSideLength

      public int getHexSideLength()
      Description copied from interface: IMap
      Gets the straight edges' length for hexagonal maps.
      Specified by:
      getHexSideLength in interface IMap
      Returns:
      the hex side length
    • setHexSideLength

      public void setHexSideLength(int hexSideLength)
    • getStaggerAxis

      public StaggerAxis getStaggerAxis()
      Description copied from interface: IMap
      Gets the staggering axis
      Specified by:
      getStaggerAxis in interface IMap
      Returns:
      the tile size
    • setStaggerAxis

      public void setStaggerAxis(StaggerAxis staggerAxis)
    • getStaggerIndex

      public StaggerIndex getStaggerIndex()
      Description copied from interface: IMap
      Gets the tile size.
      Specified by:
      getStaggerIndex in interface IMap
      Returns:
      the tile size
    • setStaggerIndex

      public void setStaggerIndex(StaggerIndex staggerIndex)
    • finish

      public void finish(URL location) throws TmxException
      Throws:
      TmxException
    • addLayer

      public void addLayer(ILayer layer)
      Description copied from interface: ILayerList
      Adds an ILayer to the Layer list.
      Specified by:
      addLayer in interface ILayerList
      Parameters:
      layer - the layer to be added
    • addLayer

      public void addLayer(int index, ILayer layer)
      Description copied from interface: ILayerList
      Adds an ILayer to the Layer list at the given index.
      Specified by:
      addLayer in interface ILayerList
      Parameters:
      index - the index
      layer - the layer to be added
    • removeLayer

      public void removeLayer(ILayer layer)
      Description copied from interface: ILayerList
      Removes an ILayer from the Layer list.
      Specified by:
      removeLayer in interface ILayerList
      Parameters:
      layer - the layer to be removed
    • removeLayer

      public void removeLayer(int index)
      Description copied from interface: ILayerList
      Removes a layer from the Layer list.
      Specified by:
      removeLayer in interface ILayerList
      Parameters:
      index - the index of the layer to be removed
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object anObject)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getRenderLayers

      public List<ILayer> getRenderLayers()
      Description copied from interface: ILayerList
      Gets all render layers in the Layer list.
      Specified by:
      getRenderLayers in interface ILayerList
      Returns:
      a List of ILayers
    • getExternalTilesets

      public List<Tileset> getExternalTilesets()
    • getBackgroundColor

      public Color getBackgroundColor()
      Specified by:
      getBackgroundColor in interface IMap
    • isInfinite

      public boolean isInfinite()
      Specified by:
      isInfinite in interface IMap