|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsprite.Sprite
sprite.sprite2d.Sprite2D
sprite.sprite2d.AnimateImageSprite
public class AnimateImageSprite
Created on November 13, 2006, 1:53 PM
A sprite used to display a specified image.
Has the ability to set a sequence of images and loop through them to create animation.
| Field Summary |
|---|
| Fields inherited from class sprite.sprite2d.Sprite2D |
|---|
fill, spriteColor |
| Fields inherited from class sprite.Sprite |
|---|
active, visible |
| Constructor Summary | |
|---|---|
AnimateImageSprite()
Creates a new instance of AnimateImageSprite |
|
| Method Summary | |
|---|---|
void |
fillImages()
Loops through the number of images in the sequence until they are all loaded. |
java.lang.String |
getBaseImageExt()
Gets the extension used for the images. |
java.lang.String |
getBaseImageName()
Gets the base image name |
java.awt.image.BufferedImage |
getBufferedImage(java.lang.String imagePath)
Gets the buffered image. |
int |
getImageCount()
Gets the number of images in the array. |
int |
getImageDirection()
Gets the direction of animation. |
int |
getImageOn()
Get the current image. |
int |
getStart()
Gets the starting image number. |
java.awt.image.BufferedImage[] |
getTheImage()
Gets the image. |
int |
getTransparentColor()
Gets the Color to make transparent. |
boolean |
isTransparent()
The backgrounds transparency state. |
void |
loadImage(java.lang.String imagePath)
Loads the image. |
java.awt.image.BufferedImage |
makeTransparent(java.awt.image.BufferedImage bImage,
java.awt.image.BufferedImage bImageTemp)
Makes background transparent. |
void |
paintSprite(java.awt.Graphics2D g)
Paints the sprite. |
void |
setBaseImageExt(java.lang.String baseImageExt)
Sets the extension to use. |
void |
setBaseImageName(java.lang.String baseImageName)
Sets the base image name. |
void |
setImageCount(int imageCount)
Sets the number of images in the array. Used to determine the number of images that need to be loaded. |
void |
setImageDirection(int imageDirection)
Sets the direction of animation. |
void |
setImageOn(int imageOn)
Sets the current image. |
void |
setStart(int start)
Sets the starting image. |
void |
setTheImage(java.awt.image.BufferedImage[] theImage)
Sets the image array. |
void |
setTransparent(boolean transparent)
Sets the transparency state of the background. |
void |
setTransparentColor(int transparentColor)
Sets the color that should be transparent. |
void |
updateSprite(java.awt.Component c)
Updates the sprite. |
boolean |
waitForImage(java.awt.Image image,
java.awt.Component c)
Waits for the image to be loaded. |
| Methods inherited from class sprite.sprite2d.Sprite2D |
|---|
checkCollision, getHeight, getSpriteColor, getStartX, getStartY, getWidth, getXPosition, getYPosition, isFill, setFill, setHeight, setSpriteColor, setStartX, setStartY, setWidth, setXPosition, setYPosition |
| Methods inherited from class sprite.Sprite |
|---|
addPropertyChangeListener, getPropertySupport, isActive, isVisible, removePropertyChangeListener, restore, setActive, setVisible, suspend |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnimateImageSprite()
| Method Detail |
|---|
public void paintSprite(java.awt.Graphics2D g)
paintSprite in class Spriteg - The graphics to paint with.public void updateSprite(java.awt.Component c)
updateSprite in class Spritec - The owner of the sprite.public void loadImage(java.lang.String imagePath)
imagePath - The path to load the image from.public java.awt.image.BufferedImage getBufferedImage(java.lang.String imagePath)
imagePath - The path to load the image from.
public java.awt.image.BufferedImage makeTransparent(java.awt.image.BufferedImage bImage,
java.awt.image.BufferedImage bImageTemp)
bImage - The image to alter.bImageTemp - The original source image.
public boolean waitForImage(java.awt.Image image,
java.awt.Component c)
image - The image being loaded.c - The component loading the image.
public java.awt.image.BufferedImage[] getTheImage()
public void setTheImage(java.awt.image.BufferedImage[] theImage)
theImage - The new image array to be used.public int getImageCount()
public void setImageCount(int imageCount)
imageCount - The total number of images loaded.public java.lang.String getBaseImageName()
public void setBaseImageName(java.lang.String baseImageName)
baseImageName - The new base image name.public java.lang.String getBaseImageExt()
public void setBaseImageExt(java.lang.String baseImageExt)
baseImageExt - The new extension.public int getImageOn()
public void setImageOn(int imageOn)
imageOn - Index of the image in the array of images.public int getImageDirection()
public void setImageDirection(int imageDirection)
imageDirection - The new direction of the animation.public void fillImages()
public int getStart()
public void setStart(int start)
start - The new start position.public int getTransparentColor()
public void setTransparentColor(int transparentColor)
transparentColor - The new transparent color.public boolean isTransparent()
public void setTransparent(boolean transparent)
transparent - True if transparent, otherwise false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||