public interface IMapOrientation
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Rectangle2D |
getBounds(int x,
int y,
IMap map)
Determines the bounding box for the tile at the given coordinates.
|
java.awt.geom.Rectangle2D |
getBounds(java.awt.Point tile,
IMap map)
Determines the bounding box for the tile at the given coordinates.
|
java.awt.geom.Rectangle2D |
getEnclosingTileBounds(double x,
double y,
IMap map)
Returns the bounding box of the tile containing the given coordinates.
|
java.awt.geom.Rectangle2D |
getEnclosingTileBounds(java.awt.geom.Point2D location,
IMap map)
Returns the bounding box of the tile containing the given coordinates.
|
java.awt.Shape |
getEnclosingTileShape(double x,
double y,
IMap map)
Returns the shape of the tile containing the given coordinates.
|
java.awt.Shape |
getEnclosingTileShape(java.awt.geom.Point2D location,
IMap map)
Returns the shape of the tile containing the given coordinates.
|
java.awt.Point |
getLocation(int x,
int y,
IMap map)
Determines the rendered location of a tile within the given
IMap , given the saved coordinates of the tile. |
java.awt.Point |
getLocation(java.awt.Point tile,
IMap map)
Determines the rendered location of a tile within the given
IMap , given the saved coordinates of the tile. |
java.lang.String |
getName()
Gets the name of this
IMapOrientation . |
java.awt.Shape |
getShape(int x,
int y,
IMap map)
Creates a
Shape for the tile at the given coordinates. |
java.awt.Shape |
getShape(java.awt.Point tile,
IMap map)
Creates a
Shape for the tile at the given coordinates. |
java.awt.Dimension |
getSize(IMap map)
Determines the size required for all tiles within the given map to be drawn into an image.
|
java.awt.Point |
getTile(double x,
double y,
IMap map)
Determines the coordinates of the tile containing the given point, as determined by
getShape(int, int, IMap) . |
java.awt.Point |
getTile(java.awt.geom.Point2D location,
IMap map)
Determines the coordinates of the tile containing the given point, as determined by
getShape(int, int, IMap) . |
java.lang.String getName()
IMapOrientation
.java.awt.Dimension getSize(IMap map)
map
- The IMap
to measurejava.awt.Point getLocation(int x, int y, IMap map)
IMap
, given the saved coordinates of the tile. The coordinates of the point
returned are those of the bottom-left corner of the tile's image relative to the top-left corner of the rectangle in which tiles in the given map
are drawn. The point returned by this method will not necessarily be contained inside the shape returned by getShape
.x
- The saved X coordinate of the tiley
- The saved Y coordinate of the tilemap
- The IMap
that the tile is injava.awt.Point getLocation(java.awt.Point tile, IMap map)
IMap
, given the saved coordinates of the tile. The coordinates of the point
returned are those of the bottom-left corner of the tile's image relative to the top-left corner of the rectangle in which tiles in the given map
are drawn. The point returned by this method will not necessarily be contained inside the shape returned by getShape
.tile
- The saved location of the tilemap
- The IMap
that the tile is injava.awt.Shape getShape(int x, int y, IMap map)
Shape
for the tile at the given coordinates. The shapes returned by this method should reflect the intended shape of a tile in
this orientation, and in general should not overlap.x
- The X coordinate of the tiley
- The Y coordinate of the tilemap
- The IMap
that the tile is injava.awt.Shape getShape(java.awt.Point tile, IMap map)
Shape
for the tile at the given coordinates. The shapes returned by this method should reflect the intended shape of a tile in
this orientation, and in general should not overlap.tile
- The location of the tilemap
- The IMap
that the tile is injava.awt.geom.Rectangle2D getBounds(int x, int y, IMap map)
orientation.getShape(x, y, map).getBounds2D()
.x
- The X coordinate of the tiley
- The Y coordinate of the tilemap
- The IMap
that the tile is injava.awt.geom.Rectangle2D getBounds(java.awt.Point tile, IMap map)
orientation.getShape(tile, map).getBounds2D()
.tile
- The location of the tilemap
- The IMap
that the tile is injava.awt.Shape getEnclosingTileShape(double x, double y, IMap map)
orientation.getShape(orientation.getTile(x, y, map), map)
.x
- The X coordinate to containy
- The Y coordinate to containmap
- The IMap
containing the tilejava.awt.Shape getEnclosingTileShape(java.awt.geom.Point2D location, IMap map)
orientation.getShape(orientation.getTile(location, map), map)
.location
- The point to containmap
- The IMap
containing the tilejava.awt.geom.Rectangle2D getEnclosingTileBounds(double x, double y, IMap map)
orientation.getShape(orientation.getTile(x, y, map), map).getBounds2D()
.x
- The X coordinate to containy
- The Y coordinate to containmap
- The IMap
containing the tilejava.awt.geom.Rectangle2D getEnclosingTileBounds(java.awt.geom.Point2D location, IMap map)
orientation.getShape(orientation.getTile(location, map), map).getBounds2D()
.location
- The point to containmap
- The IMap
containing the tilejava.awt.Point getTile(double x, double y, IMap map)
getShape(int, int, IMap)
.x
- The X coordinate to containy
- The Y coordinate to containmap
- The IMap
containing the tilejava.lang.ArithmeticException
- if the tiles are packed too tightly to resolvejava.awt.Point getTile(java.awt.geom.Point2D location, IMap map)
getShape(int, int, IMap)
.location
- The point to containmap
- The IMap
containing the tilejava.lang.ArithmeticException
- if the tiles are packed too tightly to resolve