Added a method for creating a uniform tileset that loads its source image
from a resource bundle. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1813 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: TileManager.java,v 1.24 2002/05/06 18:08:32 mdb Exp $
|
// $Id: TileManager.java,v 1.25 2002/10/17 17:42:53 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.media.tile;
|
package com.threerings.media.tile;
|
||||||
|
|
||||||
@@ -68,6 +68,23 @@ public class TileManager implements ImageProvider
|
|||||||
return uts;
|
return uts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads up a tileset from the specified image (located in the
|
||||||
|
* specified resource set) with the specified metadata parameters.
|
||||||
|
*/
|
||||||
|
public UniformTileSet loadTileSet (
|
||||||
|
final String rset, String imgPath, int count, int width, int height)
|
||||||
|
{
|
||||||
|
UniformTileSet uts = loadTileSet(imgPath, count, width, height);
|
||||||
|
// load up the image data from the image manager
|
||||||
|
uts.setImageProvider(new ImageProvider() {
|
||||||
|
public Image loadImage (String path) throws IOException {
|
||||||
|
return _imgr.getImage(rset, path);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return uts;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the tileset repository that will be used by the tile manager
|
* Sets the tileset repository that will be used by the tile manager
|
||||||
* when tiles are requested by tileset id.
|
* when tiles are requested by tileset id.
|
||||||
|
|||||||
Reference in New Issue
Block a user