public final class MapUtilities
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.awt.geom.Path2D |
convertPolylineToPath(IMapObject mapObject) |
static java.util.List<java.awt.geom.Point2D> |
convertPolylineToPointList(IMapObject mapObject) |
static IMapObject |
findMapObject(IMap map,
int id) |
static ITileset |
findTileSet(IMap map,
ITile tile)
Searches for the tile set that contains the specified tile, identified by
the grid id.
|
static ITileAnimation |
getAnimation(IMap map,
int gId) |
static java.awt.geom.Point2D |
getCenterMapLocation() |
static java.awt.geom.Point2D |
getCenterMapLocation(IMap map) |
static java.awt.geom.Point2D |
getMapLocation(IMap map,
java.awt.Point tileLocation) |
static int |
getMaxMapId(IMap map) |
static ITerrain[] |
getTerrain(IMap map,
int gId) |
static java.awt.Point |
getTile(IMap map,
double x,
double y) |
static java.awt.Point |
getTile(IMap map,
java.awt.geom.Point2D mapLocation) |
static java.awt.Point |
getTile(java.awt.geom.Point2D mapLocation) |
static java.awt.geom.Rectangle2D |
getTileBoundingBox(IMap map,
java.awt.Point tile) |
static java.awt.geom.Rectangle2D |
getTileBoundingBox(IMap map,
java.awt.geom.Point2D mapLocation) |
static java.awt.geom.Rectangle2D |
getTileBoundingBox(IMap map,
java.awt.geom.Rectangle2D box) |
static java.awt.geom.Rectangle2D |
getTileBoundingBox(int x,
int y) |
static java.awt.geom.Rectangle2D |
getTileBoundingBox(java.awt.Point tile) |
static java.awt.geom.Rectangle2D |
getTileBoundingBox(java.awt.geom.Point2D mapLocation) |
static java.util.List<ITile> |
getTilesByPixelLocation(IMap map,
java.awt.geom.Point2D location) |
static ITile |
getTopMostTile(IMap map,
java.awt.Point point) |
static ITile |
getTopMostTile(IMap map,
java.awt.geom.Point2D location) |
static ITile |
getTopMostTile(java.awt.Point point) |
static ITile |
getTopMostTile(java.awt.geom.Point2D location) |
static boolean |
hasAnimation(IMap map,
ITile tile) |
static boolean |
isStaggeredRowOrColumn(StaggerIndex staggerIndex,
int index)
Check if the row or column with the given index is staggered.
|
public static int getMaxMapId(IMap map)
public static java.awt.geom.Point2D getCenterMapLocation()
public static java.awt.geom.Point2D getCenterMapLocation(IMap map)
public static java.awt.geom.Rectangle2D getTileBoundingBox(java.awt.geom.Point2D mapLocation)
public static java.awt.geom.Rectangle2D getTileBoundingBox(IMap map, java.awt.geom.Point2D mapLocation)
public static java.awt.geom.Rectangle2D getTileBoundingBox(int x,
int y)
public static java.awt.geom.Rectangle2D getTileBoundingBox(java.awt.Point tile)
public static java.awt.geom.Rectangle2D getTileBoundingBox(IMap map, java.awt.Point tile)
public static java.awt.geom.Rectangle2D getTileBoundingBox(IMap map, java.awt.geom.Rectangle2D box)
public static java.awt.Point getTile(java.awt.geom.Point2D mapLocation)
public static java.awt.Point getTile(IMap map, java.awt.geom.Point2D mapLocation)
public static java.awt.Point getTile(IMap map, double x, double y)
public static boolean isStaggeredRowOrColumn(StaggerIndex staggerIndex, int index)
staggerIndex - the staggerIndex property of the map. Every second row (or column, depending on the StaggerAxis of the map is staggered half a
tile.index - the index of the current row or column for which we want to determine if it's staggered or not.public static java.awt.geom.Point2D getMapLocation(IMap map, java.awt.Point tileLocation)
public static java.util.List<ITile> getTilesByPixelLocation(IMap map, java.awt.geom.Point2D location)
public static ITile getTopMostTile(java.awt.geom.Point2D location)
public static ITile getTopMostTile(java.awt.Point point)
public static ITileAnimation getAnimation(IMap map, int gId)
public static ITileset findTileSet(IMap map, ITile tile)
map - the maptile - the tilepublic static java.awt.geom.Path2D convertPolylineToPath(IMapObject mapObject)
public static java.util.List<java.awt.geom.Point2D> convertPolylineToPointList(IMapObject mapObject)
public static IMapObject findMapObject(IMap map, int id)