|
GTGE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.golden.gamedev.engine.BaseLoader
public class BaseLoader
Class for loading and masking images, and also behave as storage of the loaded images.
Supported image format: png (*.png), gif (*.gif), and jpeg (*.jpg).
BaseLoader
class is using functions from
ImageUtil
class for loading and masking
images in convenient way.
This class is using BaseIO
to get the external resources.
ImageUtil
Constructor Summary | |
---|---|
BaseLoader(BaseIO base,
Color maskColor)
Constructs new BaseLoader with specified I/O loader, and
masking color. |
Method Summary | |
---|---|
BaseIO |
getBaseIO()
Returns BaseIO associated with this image loader. |
BufferedImage |
getImage(String imagefile)
Loads and returns an image with specified file using masking color. |
BufferedImage |
getImage(String imagefile,
boolean useMask)
Loads and returns an image with specified file and whether using masking color or not. |
BufferedImage[] |
getImages(String imagefile,
int col,
int row)
Loads and returns image strip with specified file using masking color. |
BufferedImage[] |
getImages(String imagefile,
int col,
int row,
boolean useMask)
Loads and returns image strip with specified file and whether using masking color or not. |
Color |
getMaskColor()
Returns image loader masking color. |
BufferedImage |
getStoredImage(String key)
Returns cache image with specified key. |
BufferedImage[] |
getStoredImages(String key)
Returns cache images with specified key. |
boolean |
removeImage(BufferedImage image)
Removes specified image from cache. |
BufferedImage |
removeImage(String imagefile)
Removes image with specified image filename from cache. |
boolean |
removeImages(BufferedImage[] images)
Removes specified images from cache. |
BufferedImage[] |
removeImages(String imagefile)
Removes images with specified image filename from cache. |
void |
setBaseIO(BaseIO base)
Sets BaseIO where the image resources is loaded from. |
void |
setMaskColor(Color c)
Sets image loader masking color. |
void |
storeImage(String key,
BufferedImage image)
Stores image into cache with specified key. |
void |
storeImages(String key,
BufferedImage[] images)
Stores images into cache with specified key. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BaseLoader(BaseIO base, Color maskColor)
BaseLoader
with specified I/O loader, and
masking color. Masking color is the color of the images that will be converted to transparent.
base
- I/O resource loadermaskColor
- the mask colorMethod Detail |
---|
public BufferedImage getImage(String imagefile, boolean useMask)
imagefile
- the image filename to be loadeduseMask
- true, the image is using transparent color
public BufferedImage getImage(String imagefile)
imagefile
- the image filename to be loaded
getImage(String, boolean)
public BufferedImage[] getImages(String imagefile, int col, int row, boolean useMask)
imagefile
- the image filename to be loadedcol
- image strip columnrow
- image strip rowuseMask
- true, the image is using transparent color
public BufferedImage[] getImages(String imagefile, int col, int row)
imagefile
- the image filename to be loadedcol
- image strip columnrow
- image strip row
getImages(String, int, int, boolean)
public void storeImage(String key, BufferedImage image)
public void storeImages(String key, BufferedImage[] images)
public BufferedImage getStoredImage(String key)
public BufferedImage[] getStoredImages(String key)
public boolean removeImage(BufferedImage image)
public boolean removeImages(BufferedImage[] images)
public BufferedImage removeImage(String imagefile)
public BufferedImage[] removeImages(String imagefile)
public BaseIO getBaseIO()
BaseIO
associated with this image loader.
setBaseIO(BaseIO)
public void setBaseIO(BaseIO base)
BaseIO
where the image resources is loaded from.
public Color getMaskColor()
setMaskColor(Color)
public void setMaskColor(Color c)
Masking color is the color of the images that will be converted to transparent.
getMaskColor()
public String toString()
toString
in class Object
|
GTGE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |