com.threerings.media.tile
Class UniformTileSet

java.lang.Object
  extended by com.threerings.media.tile.TileSet
      extended by com.threerings.media.tile.UniformTileSet
All Implemented Interfaces:
Serializable, Cloneable

public class UniformTileSet
extends TileSet

A uniform tileset is one that is composed of tiles that are all the same width and height and are arranged into rows, with each row having the same number of tiles except possibly the final row which can contain the same as or less than the number of tiles contained by the previous rows.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.media.tile.TileSet
TileSet.Colorizer
 
Field Summary
protected  int _height
          The height (in pixels) of the tiles in this tileset.
protected  int _width
          The width (in pixels) of the tiles in this tileset.
 
Fields inherited from class com.threerings.media.tile.TileSet
_atiles, _cacheStatThrottle, _imagePath, _improv, _key, _name, _zations
 
Constructor Summary
UniformTileSet()
           
 
Method Summary
 Rectangle computeTileBounds(int tileIndex, Rectangle bounds)
          Computes and fills in the bounds for the specified tile based on the mechanism used by the derived class to do such things.
 int getHeight()
          Returns the height of the tiles in this tileset.
 int getTileCount()
          Returns the number of tiles in the tileset.
 int getWidth()
          Returns the width of the tiles in this tileset.
 void setHeight(int height)
          Specifies the height of the tiles in this tileset.
 void setWidth(int width)
          Specifies the width of the tiles in this tileset.
protected  void toString(StringBuilder buf)
          Derived classes can override this, calling super.toString(buf) and then appending additional information to the buffer.
 
Methods inherited from class com.threerings.media.tile.TileSet
checkTileIndex, clone, clone, createTile, getColorizations, getImagePath, getName, getRawTileImage, getRawTileSetImage, getTile, getTile, getTile, getTileMirage, getTileMirage, getTileMirages, initTile, reportCachePerformance, setImagePath, setImageProvider, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_width

protected int _width
The width (in pixels) of the tiles in this tileset.


_height

protected int _height
The height (in pixels) of the tiles in this tileset.

Constructor Detail

UniformTileSet

public UniformTileSet()
Method Detail

getTileCount

public int getTileCount()
Description copied from class: TileSet
Returns the number of tiles in the tileset.

Specified by:
getTileCount in class TileSet

computeTileBounds

public Rectangle computeTileBounds(int tileIndex,
                                   Rectangle bounds)
Description copied from class: TileSet
Computes and fills in the bounds for the specified tile based on the mechanism used by the derived class to do such things. The width and height of the bounds should be the size of the tile image and the x and y offset should be the offset in the tileset image for the image data of the specified tile.

Specified by:
computeTileBounds in class TileSet
Parameters:
tileIndex - the index of the tile whose bounds are to be computed.
bounds - the rectangle object into which to fill the bounds.
Returns:
the rectangle passed into the bounds parameter.

setWidth

public void setWidth(int width)
Specifies the width of the tiles in this tileset.


getWidth

public int getWidth()
Returns the width of the tiles in this tileset.


setHeight

public void setHeight(int height)
Specifies the height of the tiles in this tileset.


getHeight

public int getHeight()
Returns the height of the tiles in this tileset.


toString

protected void toString(StringBuilder buf)
Description copied from class: TileSet
Derived classes can override this, calling super.toString(buf) and then appending additional information to the buffer.

Overrides:
toString in class TileSet