|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.brackeen.javagamebook.graphics.Animation
public class Animation
The Animation class manages a series of images (frames) and the amount of time to display each frame.
| Nested Class Summary | |
|---|---|
private class |
Animation.AnimFrame
|
| Field Summary | |
|---|---|
private long |
animTime
|
private int |
currFrameIndex
|
private java.util.ArrayList |
frames
|
private long |
totalDuration
|
| Constructor Summary | |
|---|---|
|
Animation()
Creates a new, empty Animation. |
private |
Animation(java.util.ArrayList frames,
long totalDuration)
|
| Method Summary | |
|---|---|
void |
addFrame(java.awt.Image image,
long duration)
Adds an image to the animation with the specified duration (time to display the image). |
java.lang.Object |
clone()
Creates a duplicate of this animation. |
private Animation.AnimFrame |
getFrame(int i)
|
java.awt.Image |
getImage()
Gets this Animation's current image. |
void |
start()
Starts this animation over from the beginning. |
void |
update(long elapsedTime)
Updates this animation's current image (frame), if neccesary. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.ArrayList frames
private int currFrameIndex
private long animTime
private long totalDuration
| Constructor Detail |
|---|
public Animation()
private Animation(java.util.ArrayList frames,
long totalDuration)
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Object
public void addFrame(java.awt.Image image,
long duration)
public void start()
public void update(long elapsedTime)
public java.awt.Image getImage()
private Animation.AnimFrame getFrame(int i)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||