|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.animation.RandomListAnimation
public class RandomListAnimation
Title: RandomListAnimation
Description: A decorator for the Animation interface, that create a random Animation from a list a Animations.
Copyright: Copyright (c) May 20, 2012
Constructor Summary | |
---|---|
protected |
RandomListAnimation()
|
|
RandomListAnimation(java.util.List<Animation> animations)
|
Method Summary | |
---|---|
void |
addAnimation(int index,
Animation animation)
The index is not used in the RandomListAnimation |
void |
addFrame(java.awt.Image image,
long duration)
This method is for adding an AnimationFrame to the animation strip. |
void |
addImageEffect(ImageEffect imageEffect)
This method is for adding an ImageSFX (special effect) to the animation. |
Animation |
copy()
Copies the animation. |
void |
draw(java.awt.Graphics2D graphics,
int x,
int y)
Draws the current frame or shape of the animation at the set x and y location. |
java.awt.Image |
getFrame(int i)
This method returns an Image at a given frame location. |
int |
getHeight()
This returns the height of the animation strip. |
java.awt.Image |
getImage()
This method returns the current frame of the animation. |
java.lang.String |
getName()
|
Sound |
getSound()
Returns the sound for this animation. |
long |
getTotalDuration()
|
int |
getWidth()
This returns the width of the animation strip. |
int |
getXOffset()
returns the Offset of the image in the X direction. |
int |
getYOffset()
returns the Offset of the image in the Y direction. |
boolean |
isAnimating()
True if this animation needs to be updated regularly. |
void |
reset()
This resets the animation strip back to its default (or initial start) frame. |
void |
setName(java.lang.String name)
Name is used for debugging. |
void |
setOffsets(int x,
int y)
Sets the offset of the image, so that it displays ideally on the screen. |
void |
setSound(TimeListeningSound sound)
Sound element associated with this animation. |
void |
update(long elapseTime)
This method takes the elapse time, and calculates the new current frame of the animation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomListAnimation(java.util.List<Animation> animations)
protected RandomListAnimation()
Method Detail |
---|
public void addAnimation(int index, Animation animation)
addAnimation
in interface ComplexAnimation
index
- animation
- public void addFrame(java.awt.Image image, long duration)
Animation
addFrame
in interface Animation
image
- Imageduration
- longpublic void addImageEffect(ImageEffect imageEffect)
Animation
addImageEffect
in interface Animation
public Animation copy()
Animation
copy
in interface Animation
public void draw(java.awt.Graphics2D graphics, int x, int y)
Animation
draw
in interface Animation
public java.awt.Image getFrame(int i)
Animation
getFrame
in interface Animation
i
- int
public int getHeight()
Animation
getHeight
in interface Animation
public java.lang.String getName()
getName
in interface Updateable
public java.awt.Image getImage()
Animation
getImage
in interface Animation
public Sound getSound()
Animation
getSound
in interface Animation
public long getTotalDuration()
getTotalDuration
in interface Animation
public int getWidth()
Animation
getWidth
in interface Animation
public int getXOffset()
Animation
getXOffset
in interface Animation
public int getYOffset()
Animation
getYOffset
in interface Animation
public boolean isAnimating()
Animation
isAnimating
in interface Animation
public void reset()
Animation
reset
in interface Animation
public void setName(java.lang.String name)
Animation
setName
in interface Animation
name
- Stringpublic void setSound(TimeListeningSound sound)
Animation
setSound
in interface Animation
public void setOffsets(int x, int y)
Animation
setOffsets
in interface Animation
public void update(long elapseTime)
Animation
update
in interface Animation
update
in interface Updateable
elapseTime
- long
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |