mhframework.tilemap
Class MHTileSetManager

java.lang.Object
  extended by mhframework.tilemap.MHTileSetManager

public class MHTileSetManager
extends java.lang.Object

This class manages the complete collection of all the tilesets in a game. The tiles are organized in three separate groups: floor tiles, static wall tiles, and interactive tiles.

Note: This class stores tile images only. These are NOT the actor objects represented by the images.

How to create tiles for a tileset:

  1. Create the tile image. Follow the directions in the guidelines document.
  2. Save it with a filename that follows this pattern:

To initialize an MHTileSetManager object, simply call the loadTileSet() method with a tile set number, or use the constructor that takes the tile set number parameter.


Field Summary
static int MAX_TILE_SETS
          Maximum number of supported tile sets.
static int NULL_TILE_ID
          Placeholder indicating that tile should be null.
static java.lang.String TILE_SET_DIRECTORY
           
 
Constructor Summary
MHTileSetManager()
          Constructor.
MHTileSetManager(int tileSetNumber)
          Constructor.
 
Method Summary
 int getCurrentTileSetID()
          Returns the identifier of this tileset.
 java.awt.Image getTileImage(int layer, int tileNum, int animFrame)
          Returns the requested tile image.
 MHImageGroup getTileImageGroup(int layer)
          Returns the image group for a layer of tiles.
 void loadTileSet(int tileSetNumber)
          Loads the tile set specified by the given tile set number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_TILE_ID

public static final int NULL_TILE_ID
Placeholder indicating that tile should be null.

See Also:
Constant Field Values

MAX_TILE_SETS

public static final int MAX_TILE_SETS
Maximum number of supported tile sets. Valid values for tile set IDs are 00 - 99.

See Also:
Constant Field Values

TILE_SET_DIRECTORY

public static final java.lang.String TILE_SET_DIRECTORY
See Also:
Constant Field Values
Constructor Detail

MHTileSetManager

public MHTileSetManager()
Constructor.


MHTileSetManager

public MHTileSetManager(int tileSetNumber)
Constructor.

Method Detail

loadTileSet

public void loadTileSet(int tileSetNumber)
Loads the tile set specified by the given tile set number.

Parameters:
tileSetNumber - The number of the tile set to be loaded.

getCurrentTileSetID

public int getCurrentTileSetID()
Returns the identifier of this tileset.


getTileImage

public java.awt.Image getTileImage(int layer,
                                   int tileNum,
                                   int animFrame)
Returns the requested tile image.


getTileImageGroup

public MHImageGroup getTileImageGroup(int layer)
Returns the image group for a layer of tiles.