Added multiframe image accessor for tile sets.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3558 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -36,6 +36,8 @@ import com.threerings.media.image.Colorization;
|
||||
import com.threerings.media.image.Mirage;
|
||||
import com.threerings.media.image.ImageUtil;
|
||||
import com.threerings.media.image.BufferedMirage;
|
||||
import com.threerings.media.util.MultiFrameImage;
|
||||
import com.threerings.media.util.MultiFrameImageImpl;
|
||||
|
||||
/**
|
||||
* A tileset stores information on a single logical set of tiles. It
|
||||
@@ -226,6 +228,25 @@ public abstract class TileSet
|
||||
return tile;
|
||||
}
|
||||
|
||||
/** Returns a multiframe image of all the tiles in this tile set. */
|
||||
public MultiFrameImage getTileMultiFrameImage ()
|
||||
{
|
||||
return getTileMultiFrameImage(null);
|
||||
}
|
||||
|
||||
/** Returns a multiframe image of all the tiles in this tile set. */
|
||||
public MultiFrameImage getTileMultiFrameImage (Colorization[] zations)
|
||||
{
|
||||
// Load each tile's image
|
||||
Mirage[] images = new Mirage[getTileCount()];
|
||||
for (int i = 0; i < images.length; i++) {
|
||||
images[i] = getTileMirage(i, zations);
|
||||
}
|
||||
|
||||
// Construct a multiframe image from these images
|
||||
return new MultiFrameImageImpl(images);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a prepared version of the image that would be used by the
|
||||
* tile at the specified index. Because tilesets are often used simply
|
||||
|
||||
Reference in New Issue
Block a user