Interface IMap

All Superinterfaces:
Comparable<IMap>, ICustomPropertyProvider, ILayerList
All Known Implementing Classes:
TmxMap

public interface IMap extends ILayerList, Comparable<IMap>

Engine-facing representation of a tile map and its layer hierarchy.

Dimensions returned by getWidth() and getHeight() are measured in tiles; use getSizeInPixels() or getBounds() for map-coordinate dimensions. Maps loaded from TMX are represented by TmxMap.

See Also:
  • Method Details

    • getTilesets

      List<ITileset> getTilesets()
      Gets the tilesets.
      Returns:
      the tilesets
    • getTilesetEntry

      ITilesetEntry getTilesetEntry(int gid)
      Gets the tileset entry referenced by the supplied global tile id.
      Parameters:
      gid - the global tile id
      Returns:
      the matching tileset entry, or null if no tileset contains the id
    • getOrientation

      IMapOrientation getOrientation()
      Gets the orientation.
      Returns:
      the orientation
    • getPath

      URL getPath()
      Gets the source URL the map was loaded from.
      Returns:
      the source URL
    • getRenderOrder

      RenderOrder getRenderOrder()
      Gets the order in which orthogonal tile coordinates are rendered.
      Returns:
      the render order declared by the map
    • getSizeInPixels

      Dimension getSizeInPixels()
      Gets the size in pixels.
      Returns:
      the size in pixels
    • getWidth

      int getWidth()
      Gets the map width in tiles.
      Returns:
      the width in tiles
    • getHeight

      int getHeight()
      Gets the map height in tiles.
      Returns:
      the height in tiles
    • getSizeInTiles

      Dimension getSizeInTiles()
      Gets the width and height in tiles.
      Returns:
      the map size in tiles
    • getBounds

      Rectangle2D getBounds()
      Gets the bounding rectangle of the map in pixels.
      Returns:
      the bounding rectangle
    • getTileSize

      Dimension getTileSize()
      Gets the tile size.
      Returns:
      the tile size
    • getParallaxOrigin

      Point2D getParallaxOrigin()
      Gets the coordinates of the parallax origin in pixels.
      Returns:
      The parallax origin.
    • getTileWidth

      int getTileWidth()
      Gets the horizontal tile size.
      Returns:
      the horizontal tile size
    • getTileHeight

      int getTileHeight()
      Gets the vertical tile size.
      Returns:
      the vertical tile size
    • getHexSideLength

      int getHexSideLength()
      Gets the straight edges' length for hexagonal maps.
      Returns:
      the hex side length
    • getStaggerAxis

      StaggerAxis getStaggerAxis()
      Gets the axis along which hexagonal or staggered rows are offset.
      Returns:
      the staggering axis
    • getStaggerIndex

      StaggerIndex getStaggerIndex()
      Gets whether even or odd indexes are staggered.
      Returns:
      the staggering index
    • getVersion

      double getVersion()
      Gets the version.
      Returns:
      the version
    • getTiledVersion

      String getTiledVersion()
      Gets the Tiled editor version string the map was saved with.
      Returns:
      the Tiled version string
    • getName

      String getName()
      Gets the display name of this map.
      Returns:
      the map name
    • setName

      void setName(String name)
      Sets the name.
      Parameters:
      name - the new name
    • getNextObjectId

      int getNextObjectId()
      Gets the next available object id, used to assign unique ids to newly created map objects.
      Returns:
      the next object id
    • getNextLayerId

      int getNextLayerId()
      Gets the next available layer id, used to assign unique ids to newly created layers.
      Returns:
      the next layer id
    • getBackgroundColor

      Color getBackgroundColor()
      Gets the background color of the map.
      Returns:
      the background color
    • isInfinite

      boolean isInfinite()
      Returns whether this is an infinite map (i.e. composed of chunks rather than a fixed-size grid).
      Returns:
      true if the map is infinite
    • compareTo

      default int compareTo(IMap map)
      Specified by:
      compareTo in interface Comparable<IMap>