java.lang.ObjectAnimatedImage
public class AnimatedImage
AnimatedImage Class This class is for creating a collection of GreenfootImages to appear as frames. The frames are created from using a single greenfoot image. The class will create an image for each frame, and draw the image for that frame from the image supplied. It will then be stored as a Greenfoot Image in a collection.
Constructor Summary | |
---|---|
AnimatedImage(java.lang.String fileName,
int noFrames,
int frameWidth,
int frameHeight)
The constructor, which creates all the indevidual frames from the image supplied. |
Method Summary | |
---|---|
greenfoot.GreenfootImage |
getFrame(int frame)
Returns a frame based on the index value used. |
int |
getFrameHeight()
Returns the height of each frame. |
int |
getFrameWidth()
Returns the width of each frame. |
int |
getNumberOfFrames()
Returns the number of frames in this animated image type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnimatedImage(java.lang.String fileName, int noFrames, int frameWidth, int frameHeight)
fileName
- the name of the imagenoFrames
- the number of frames in the imageframeWidth
- the width of each frameframeHeight
- the height of each frameMethod Detail |
---|
public greenfoot.GreenfootImage getFrame(int frame)
frame
- the index number of the frame you require
public int getFrameHeight()
public int getFrameWidth()
public int getNumberOfFrames()