|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.animation.BaseAnimation
org.deken.game.animation.LayeredAnimation
public class LayeredAnimation
Title: LayeredAnimation
Description: TODO
Copyright: Copyright (c) Nov 19, 2013
Field Summary |
---|
Fields inherited from class org.deken.game.animation.BaseAnimation |
---|
height, imageEffect, name, sequenceTime, sound, totalDuration, totalFrames, width, xOffset, yOffset |
Constructor Summary | |
---|---|
LayeredAnimation(int numberOfLayers)
|
|
LayeredAnimation(java.util.List<Animation> animations)
|
Method Summary | |
---|---|
void |
addAnimation(int index,
Animation animation)
|
void |
addFrame(java.awt.Image image,
long duration)
This method is for adding an AnimationFrame to the animation strip. |
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. |
Animation |
getAnimation(int layer)
|
java.awt.Image |
getFrame(int i)
This method returns an Image at a given frame location. |
java.awt.Image |
getImage()
This method returns the current frame of the animation. |
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 |
setAllLayers(boolean active)
Deactivate all layers from rendering. |
void |
setLayerActive(int layer,
boolean active)
Sets a specific layer as active or inactive, depending on the value passed in. |
void |
update(long elapseTime)
This method takes the elapse time, and calculates the new current frame of the animation. |
Methods inherited from class org.deken.game.animation.BaseAnimation |
---|
addImageEffect, baseUpdate, copyParent, getHeight, getName, getSound, getTotalDuration, getWidth, getXOffset, getYOffset, setName, setOffsets, setSound |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.deken.game.animation.Animation |
---|
addImageEffect, getHeight, getSound, getTotalDuration, getWidth, getXOffset, getYOffset, setName, setOffsets, setSound |
Methods inherited from interface org.deken.game.Updateable |
---|
getName |
Constructor Detail |
---|
public LayeredAnimation(int numberOfLayers)
public LayeredAnimation(java.util.List<Animation> animations)
Method Detail |
---|
public void addAnimation(int index, Animation animation)
addAnimation
in interface ComplexAnimation
public void addFrame(java.awt.Image image, long duration)
Animation
addFrame
in interface Animation
image
- Imageduration
- longpublic void setAllLayers(boolean active)
active
- public void draw(java.awt.Graphics2D graphics, int x, int y)
Animation
draw
in interface Animation
public void reset()
Animation
reset
in interface Animation
public void update(long elapseTime)
Animation
update
in interface Animation
update
in interface Updateable
elapseTime
- longpublic Animation getAnimation(int layer)
public java.awt.Image getFrame(int i)
Animation
getFrame
in interface Animation
i
- int
public java.awt.Image getImage()
Animation
getImage
in interface Animation
public boolean isAnimating()
Animation
isAnimating
in interface Animation
public void setLayerActive(int layer, boolean active)
layer
- active
- public Animation copy()
Animation
copy
in interface Animation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |