java.lang.ObjectAnimation
public class Animation
Animation class
| Constructor Summary | |
|---|---|
Animation(java.lang.String animString,
int numFrames,
boolean loop)
|
|
Animation(java.lang.String animString,
int numFrames,
java.lang.String keyStroke,
boolean loop)
Construct the animation |
|
| Method Summary | |
|---|---|
java.lang.String |
getAnimString()
Getter for base string for animation |
greenfoot.GreenfootImage |
getCurrentImage()
Getter for current Image |
java.lang.String |
getKeyStroke()
Getter for trigger keyStroke |
greenfoot.GreenfootImage |
getNextFrame()
Getter for the next frame image update current frame, stop animating if applies, and return the currentImage |
boolean |
isLastFrame()
Returns a boolean telling wether or not the animation is in its last frame |
greenfoot.GreenfootImage |
resetAnimation()
Reset this animation to frame 0 |
void |
scaleAnimation(double scaleFactor)
|
void |
ScaleImage(greenfoot.GreenfootImage theImage,
double scaleFactor)
|
void |
stopAnimation()
Stop Animating |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Animation(java.lang.String animString,
int numFrames,
boolean loop)
public Animation(java.lang.String animString,
int numFrames,
java.lang.String keyStroke,
boolean loop)
animString - base word for the animation (if the pictures are actor1.png,actor2.png,
actor3.png, then the animString is actornumFrames - number of frames in this animationkeystroke - keyStroke that triggers this animationloop - whether the animation loops or not| Method Detail |
|---|
public java.lang.String getAnimString()
public greenfoot.GreenfootImage getCurrentImage()
original - true if want to return the original image, false if want to return
mirror image
public java.lang.String getKeyStroke()
public greenfoot.GreenfootImage getNextFrame()
original - true if want to return the original image, false if want to return
mirror imagepublic boolean isLastFrame()
public greenfoot.GreenfootImage resetAnimation()
public void scaleAnimation(double scaleFactor)
public void ScaleImage(greenfoot.GreenfootImage theImage,
double scaleFactor)
public void stopAnimation()