|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmhframework.tilemap.MHTileMap
mhframework.tilemap.MHIsometricMap
public abstract class MHIsometricMap
Abstract base class for deriving isometric tile maps.
Field Summary | |
---|---|
protected boolean |
cursorFlasher
|
protected boolean |
cursorOn
|
protected MHIsoMouseMap |
mouseMap
|
Fields inherited from class mhframework.tilemap.MHTileMap |
---|
anchorSpace, cursorAddress, cursorAnchor, cursorPoint, DIR_EAST, DIR_NORTH, DIR_NORTHEAST, DIR_NORTHWEST, DIR_SOUTH, DIR_SOUTHEAST, DIR_SOUTHWEST, DIR_WEST, MAX_DIRECTIONS, screenAnchor, screenSpace, worldSpace |
Constructor Summary | |
---|---|
MHIsometricMap(java.lang.String filename,
MHObjectFactory vendor)
Constructor. |
Method Summary | |
---|---|
void |
advance()
Tells an object to update its data. |
protected void |
drawCursor(java.awt.Graphics g)
|
int |
getTileHeight()
Returns the vertical height of the standard base tile image in this tile map. |
boolean |
isCursorOn()
Returns the cursorOn. |
MHMapCellAddress |
mapMouse(java.awt.Point mousePoint)
Converts a screen (mouse) coordinate into a map coordinate. |
abstract java.awt.Point |
plotTile(int row,
int column)
Calculates the pixel position at which the input actor will be rendered. |
void |
render(java.awt.Graphics2D g)
Renders the map onto the sent Graphics object using an optimized algorithm. |
void |
render(java.awt.Graphics2D g,
boolean optimized)
Draws the map onto the sent Graphics object. |
void |
render(java.awt.Graphics2D g,
boolean[] flags)
Renders the selected layers of the map onto the sent Graphics object using an optimized algorithm. |
void |
setCursorOn(boolean cursorOn)
Sets the cursorOn. |
protected abstract MHMapCellAddress |
tileWalk(int row,
int column,
int direction)
Calculates the next map position to which an actor would walk if it were in position (row, column) and travelled in the direction specified by direction. |
protected MHMapCellAddress |
tileWalk(MHMapCellAddress origin,
int direction)
Calculates the next map position to which an actor would walk if it were in the position specified by origin and travelled in the direction specified by direction. |
Methods inherited from class mhframework.tilemap.MHTileMap |
---|
calculateAnchorSpace, calculateWorldSpace, clipCursorAddress, clipScreenAnchor, getCursorAddress, getCursorPoint, getMapData, getScreenAnchor, getScreenSpace, getTileWidth, isAnchorCoordinate, isScreenCoordinate, isWorldCoordinate, mouseMoved, screenToWorld, scrollMap, setCursorPoint, setScreenAnchor, setScreenAnchor, setScreenSpace, setTileWidth, worldToScreen |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MHIsoMouseMap mouseMap
protected boolean cursorOn
protected boolean cursorFlasher
Constructor Detail |
---|
public MHIsometricMap(java.lang.String filename, MHObjectFactory vendor)
data
- A reference to the application's data model.filename
- The name of the map file to be loaded into this tile
map.vendor
- A reference to an existing MHObjectVendor for
instantiating interactive actor objects.Method Detail |
---|
protected abstract MHMapCellAddress tileWalk(int row, int column, int direction)
row
- The actor's current row position.column
- The actor's current column position.direction
- The direction in which to walk.
protected MHMapCellAddress tileWalk(MHMapCellAddress origin, int direction)
origin
- The actor's current map cell position.direction
- The direction in which to walk.
public abstract java.awt.Point plotTile(int row, int column)
plotTile
in class MHTileMap
row
- The row of the map containing the actor (tile) to be
plotted.column
- The column of the map containing the actor (tile) to
be plotted.
public int getTileHeight()
getTileHeight
in class MHTileMap
public MHMapCellAddress mapMouse(java.awt.Point mousePoint)
mapMouse
in class MHTileMap
mousePoint
- A point representing a mouse coordinate.
public void render(java.awt.Graphics2D g, boolean optimized)
g
- The graphics object on which we are rendering the
map.optimized
- A flag indicating whether to use the optimized
rendering algorithm.public void render(java.awt.Graphics2D g)
render
in interface MHRenderable
render
in class MHTileMap
g
- The graphics object on which we are rendering the
map.public void render(java.awt.Graphics2D g, boolean[] flags)
g
- The graphics object on which we are rendering the
map.flags
- An array of flags indicating which layers are to be
rendered.protected void drawCursor(java.awt.Graphics g)
public void advance()
MHRenderable
advance
in interface MHRenderable
advance
in class MHTileMap
public boolean isCursorOn()
public void setCursorOn(boolean cursorOn)
cursorOn
- The cursorOn to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |