|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.golden.gamedev.engine.BaseLoader
Class for loading and storing game images. Supported image type: png (*.png), gif (*.gif), and jpeg (*.jpg).
This class use BaseIO
to get the external resources.
Constructor Summary | |
BaseLoader(BaseIO base,
Color maskColor)
|
Method Summary | |
BaseIO |
getBaseIO()
|
BufferedImage |
getCacheImage(String key)
Returns specified image key from cache. |
BufferedImage[] |
getCacheImages(String key)
Returns specified image key from cache. |
BufferedImage |
getImage(String imagefile)
|
BufferedImage |
getImage(String imagefile,
boolean useMask)
Loads and returns an image with specified file and masking color. |
BufferedImage[] |
getImages(String imagefile,
int col,
int row)
|
BufferedImage[] |
getImages(String imagefile,
int col,
int row,
boolean useMask)
Loads and returns image strip with specified file and masking color. |
Color |
getMaskColor()
|
void |
putImage(String key,
BufferedImage image)
Inserts specified image to cache. |
void |
putImages(String key,
BufferedImage[] images)
Inserts specified images to cache. |
boolean |
removeImage(BufferedImage image)
Removes specified image from cache. |
BufferedImage |
removeImage(String imagefile)
Removes image with specified file from cache. |
boolean |
removeImages(BufferedImage[] images)
Removes specified images from cache. |
BufferedImage[] |
removeImages(String imagefile)
Removes images with specified file from cache. |
void |
setBaseIO(BaseIO base)
|
void |
setMaskColor(Color c)
|
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)
Method Detail |
public BaseIO getBaseIO()
public void setBaseIO(BaseIO base)
public Color getMaskColor()
public void setMaskColor(Color c)
public BufferedImage getImage(String imagefile, boolean useMask)
imagefile
- the image file to be loadeduseMask
- true, the image will use transparent color
public BufferedImage getImage(String imagefile)
public BufferedImage[] getImages(String imagefile, int col, int row, boolean useMask)
imagefile
- the image file to be loadedcol
- image strip columnrow
- image strip rowuseMask
- true, the image will use transparent color
public BufferedImage[] getImages(String imagefile, int col, int row)
public void putImage(String key, BufferedImage image)
public void putImages(String key, BufferedImage[] images)
public BufferedImage getCacheImage(String key)
public BufferedImage[] getCacheImages(String key)
public boolean removeImage(BufferedImage image)
public boolean removeImages(BufferedImage[] images)
public BufferedImage removeImage(String imagefile)
public BufferedImage[] removeImages(String imagefile)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |