Interface IMap
- All Superinterfaces:
Comparable<IMap>, ICustomPropertyProvider, ILayerList
- All Known Implementing Classes:
TmxMap
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 Summary
Modifier and TypeMethodDescriptiondefault intGets the background color of the map.Gets the bounding rectangle of the map in pixels.intGets the map height in tiles.intGets the straight edges' length for hexagonal maps.getName()Gets the display name of this map.intGets the next available layer id, used to assign unique ids to newly created layers.intGets the next available object id, used to assign unique ids to newly created map objects.Gets the orientation.Gets the coordinates of the parallax origin in pixels.getPath()Gets the source URL the map was loaded from.Gets the order in which orthogonal tile coordinates are rendered.Gets the size in pixels.Gets the width and height in tiles.Gets the axis along which hexagonal or staggered rows are offset.Gets whether even or odd indexes are staggered.Gets the Tiled editor version string the map was saved with.intGets the vertical tile size.getTilesetEntry(int gid) Gets the tileset entry referenced by the supplied global tile id.Gets the tilesets.Gets the tile size.intGets the horizontal tile size.doubleGets the version.intgetWidth()Gets the map width in tiles.booleanReturns whether this is an infinite map (i.e. composed of chunks rather than a fixed-size grid).voidSets the name.Methods inherited from interface ICustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, hasCustomProperty, removeProperty, setProperties, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueMethods inherited from interface ILayerList
addLayer, addLayer, getGroupLayers, getImageLayers, getMapObject, getMapObjectLayer, getMapObjectLayer, getMapObjectLayer, getMapObjectLayers, getMapObjects, getMapObjects, getMapObjects, getRenderLayers, getTileLayers, removeLayer, removeLayer, removeMapObject
-
Method Details
-
getTilesets
-
getTilesetEntry
Gets the tileset entry referenced by the supplied global tile id.- Parameters:
gid- the global tile id- Returns:
- the matching tileset entry, or
nullif no tileset contains the id
-
getOrientation
-
getPath
-
getRenderOrder
RenderOrder getRenderOrder()Gets the order in which orthogonal tile coordinates are rendered.- Returns:
- the render order declared by the map
-
getSizeInPixels
-
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
-
getBounds
Rectangle2D getBounds()Gets the bounding rectangle of the map in pixels.- Returns:
- the bounding rectangle
-
getTileSize
-
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
-
setName
-
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
-
isInfinite
boolean isInfinite()Returns whether this is an infinite map (i.e. composed of chunks rather than a fixed-size grid).- Returns:
trueif the map is infinite
-
compareTo
- Specified by:
compareToin interfaceComparable<IMap>
-