Package megamek.common.util
Class ImageUtil.AtlasImageLoader
java.lang.Object
megamek.common.util.ImageUtil.TileMapImageLoader
megamek.common.util.ImageUtil.AtlasImageLoader
- All Implemented Interfaces:
ImageUtil.ImageLoader
- Enclosing class:
ImageUtil
ImageLoader that loads sub-regions from a larger atlas file, but is given file names that are mapped into an
atlas. When constructed, this class reads in a map that maps image files to an atlas image and offset location.
When an image file is requested to be opened, it first looks to see if the map contains that file, and if it does
return an image from the corresponding key which includes an atlas and offset.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class megamek.common.util.ImageUtil.TileMapImageLoader
parseCoords
-
Constructor Details
-
AtlasImageLoader
public AtlasImageLoader()
-
-
Method Details
-
loadImage
Description copied from class:ImageUtil.TileMapImageLoaderGiven a string with the format {imageFile}(X,Y-W,H), load the image file and then use X,Y and W,H to find a sub-image within the original image and return that sub-image.- Specified by:
loadImagein interfaceImageUtil.ImageLoader- Overrides:
loadImagein classImageUtil.TileMapImageLoader- Parameters:
fileName- File to load.- Returns:
- An
Imageobject
-