|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.tile.TileSet
com.threerings.media.tile.SwissArmyTileSet
public class SwissArmyTileSet
The swiss army tileset supports a diverse variety of tiles in the tileset image. Each row can contain varying numbers of tiles and each row can have its own width and height. Tiles can be separated from the edge of the tileset image by some border offset and can be separated from one another by a gap distance.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.media.tile.TileSet |
|---|
TileSet.Colorizer |
| Field Summary | |
|---|---|
protected Dimension |
_gapSize
The distance (x, y) in pixels between each tile in each row horizontally, and between each row of tiles vertically. |
protected int[] |
_heights
The height of the tiles in each row in pixels. |
protected int |
_numTiles
The number of tiles in the tileset. |
protected Point |
_offsetPos
The offset distance (x, y) in pixels from the top-left of the image to the start of the first tile image. |
protected int[] |
_tileCounts
The number of tiles in each row. |
protected int[] |
_widths
The width of the tiles in each row in pixels. |
| Fields inherited from class com.threerings.media.tile.TileSet |
|---|
_atiles, _cacheStatThrottle, _imagePath, _improv, _key, _name, _zations |
| Constructor Summary | |
|---|---|
SwissArmyTileSet()
|
|
| 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. |
protected void |
computeTileCount()
Computes our total tile count from the individual counts for each row. |
int[] |
getHeights()
Returns the height settings. |
int |
getTileCount()
Returns the number of tiles in the tileset. |
int[] |
getTileCounts()
Returns the tile count settings. |
int[] |
getWidths()
Returns the width settings. |
void |
setGapSize(Dimension gapSize)
Sets the size of the gap between tiles (in pixels). |
void |
setHeights(int[] heights)
Sets the tile heights for each row. |
void |
setOffsetPos(Point offsetPos)
Sets the offset in pixels of the upper left corner of the first tile in the first row. |
void |
setTileCounts(int[] tileCounts)
Sets the tile counts which are the number of tiles in each row of the tileset image. |
void |
setWidths(int[] widths)
Sets the tile widths for each row. |
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 |
|---|
protected int[] _tileCounts
protected int _numTiles
protected int[] _widths
protected int[] _heights
protected Point _offsetPos
protected Dimension _gapSize
| Constructor Detail |
|---|
public SwissArmyTileSet()
| Method Detail |
|---|
public int getTileCount()
TileSet
getTileCount in class TileSet
public Rectangle computeTileBounds(int tileIndex,
Rectangle bounds)
TileSet
computeTileBounds in class TileSettileIndex - the index of the tile whose bounds are to be computed.bounds - the rectangle object into which to fill the bounds.
public void setTileCounts(int[] tileCounts)
public int[] getTileCounts()
protected void computeTileCount()
public void setWidths(int[] widths)
public int[] getWidths()
public void setHeights(int[] heights)
public int[] getHeights()
public void setOffsetPos(Point offsetPos)
public void setGapSize(Dimension gapSize)
protected void toString(StringBuilder buf)
TileSetsuper.toString(buf) and then
appending additional information to the buffer.
toString in class TileSet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||