|
||||||||||
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.TileAnimation
public class TileAnimation
Title: TileAnimationStrip Description: Copyright: Copyright (c) 2005
Field Summary |
---|
Fields inherited from class org.deken.game.animation.BaseAnimation |
---|
height, imageEffect, name, sequenceTime, sound, totalDuration, totalFrames, width, xOffset, yOffset |
Constructor Summary | |
---|---|
protected |
TileAnimation()
Used by copy(). |
Method Summary | |
---|---|
void |
addFrame(java.awt.Image image,
long duration)
Animation Strip |
TileAnimation |
copy()
Copy Animation |
void |
draw(java.awt.Graphics2D graphics,
int x,
int y)
Draws the current frame index to the GameGFX, including any animation offsets. |
boolean |
equals(java.lang.Object obj)
Determines if two animation strips are the same, based on size of image and number of frames. |
float |
getDirection()
Returns the direction the tile is moving. |
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 |
setDirection(float direction,
double speed)
Set the direction and speed the tile moves. |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TileAnimation()
Method Detail |
---|
public void addFrame(java.awt.Image image, long duration)
image
- duration
- public void draw(java.awt.Graphics2D graphics, int x, int y)
graphics
- x
- y
- public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object
public void reset()
Animation
public void update(long elapseTime)
Animation
elapseTime
- longpublic float getDirection()
public java.awt.Image getFrame(int i)
Animation
i
- int
public java.awt.Image getImage()
Animation
public boolean isAnimating()
Animation
public void setDirection(float direction, double speed)
direction
- floatspeed
- doublepublic TileAnimation copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |