hermes.animation
Class Tileset

java.lang.Object
  extended by hermes.animation.Tileset

public class Tileset
extends java.lang.Object


Constructor Summary
Tileset(PImage tileImage, int tileWidth, int tileHeight)
           
 
Method Summary
 int getNumberOfCols()
           
 int getNumberOfRows()
           
 PImage[] getRowOfTiles(int row)
          Get a row of PImages from the Tileset
Note: You might find this handy for building an Animation for an AnimatedSprite
 PImage getTile(int row, int col)
          Get a single tile from the Tilemap
 int getTileHeight()
          Get the height of each tile
 int getTileWidth()
          Get the width of each tile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tileset

public Tileset(PImage tileImage,
               int tileWidth,
               int tileHeight)
Parameters:
tileImage - PImage of tileset to cut up
tileWidth - width of tiles in the set, in pixels
tileHeight - height of tiles in the set, in pixels
Method Detail

getTile

public PImage getTile(int row,
                      int col)
Get a single tile from the Tilemap

Parameters:
row - row that the tile is in
col - col that the tile is in
Returns:
a PImage of the tile

getTileWidth

public int getTileWidth()
Get the width of each tile

Returns:
the width of each tile

getTileHeight

public int getTileHeight()
Get the height of each tile

Returns:
the height of each tile

getNumberOfCols

public int getNumberOfCols()

getNumberOfRows

public int getNumberOfRows()

getRowOfTiles

public PImage[] getRowOfTiles(int row)
Get a row of PImages from the Tileset
Note: You might find this handy for building an Animation for an AnimatedSprite

Parameters:
row - the index of the row to be returned
Returns:
the row of PImages