public class TrimmedObjectTileSet extends TileSet implements RecolorableTileSet, BaseSizableTileSet
TileSet.Colorizer| Constructor and Description |
|---|
TrimmedObjectTileSet() |
| Modifier and Type | Method and Description |
|---|---|
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 |
getBaseHeight(int tileIdx)
Returns the base height for the specified object index.
|
int |
getBaseWidth(int tileIdx)
Returns the base width for the specified object index.
|
String[] |
getColorizations()
Returns the colorization classes that should be used to recolor
objects in this tileset.
|
String[] |
getConstraints(int tileIdx)
Returns the constraints associated with the specified tile index, or
null if
the object has no associated constraints. |
int |
getSpotOrient(int tileIdx)
Returns the orientation of the spot associated with the specified tile index, or
-1 if the object has no associated spot. |
int |
getTileCount()
Returns the number of tiles in the tileset.
|
int |
getXSpot(int tileIdx)
Returns the x coordinate of the spot associated with the specified tile index.
|
int |
getYSpot(int tileIdx)
Returns the y coordinate of the spot associated with the specified tile index.
|
boolean |
hasConstraint(int tileIdx,
String constraint)
Checks whether the tile at the specified index has the given constraint.
|
static TrimmedObjectTileSet |
trimObjectTileSet(ObjectTileSet source,
OutputStream destImage)
Convenience function to trim the tile set to a file using FastImageIO.
|
static TrimmedObjectTileSet |
trimObjectTileSet(ObjectTileSet source,
OutputStream destImage,
String imgFormat)
Creates a trimmed object tileset from the supplied source object tileset.
|
clone, clone, getImagePath, getName, getRawTileImage, getRawTileSetImage, getTile, getTile, getTile, getTileMirage, getTileMirage, getTileMirages, setImagePath, setImageProvider, setName, toStringpublic int getTileCount()
TileSetgetTileCount in class TileSetpublic Rectangle computeTileBounds(int tileIndex, Rectangle bounds)
TileSetcomputeTileBounds 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 int getXSpot(int tileIdx)
public int getYSpot(int tileIdx)
public int getSpotOrient(int tileIdx)
-1 if the object has no associated spot.public String[] getConstraints(int tileIdx)
null if
the object has no associated constraints.public boolean hasConstraint(int tileIdx,
String constraint)
public String[] getColorizations()
RecolorableTileSetgetColorizations in interface RecolorableTileSetpublic int getBaseWidth(int tileIdx)
getBaseWidth in interface BaseSizableTileSetpublic int getBaseHeight(int tileIdx)
getBaseHeight in interface BaseSizableTileSetpublic static TrimmedObjectTileSet trimObjectTileSet(ObjectTileSet source, OutputStream destImage) throws IOException
IOExceptionpublic static TrimmedObjectTileSet trimObjectTileSet(ObjectTileSet source, OutputStream destImage, String imgFormat) throws IOException
destImage parameter is actually stored on the file system. If imgFormat is
null, uses FastImageIO to save the file. See TileSetTrimmer.trimTileSet(com.threerings.media.tile.TileSet, java.io.OutputStream, com.threerings.media.tile.util.TileSetTrimmer.TrimMetricsReceiver) for further
information.IOExceptionCopyright © 2015. All rights reserved.