java.lang.ObjectGifImage
public class GifImage
This class can be used to read animated gif image files and extract the individual images of the animation sequence.
To use GifImage in an actor, declare it as an instance variable:
GifImage gifImage = new GifImage("mygif.gif");
Then, in the act() method of your actor, set the actor's image to the current image
from your GifImage instance:
setImage(gifImage.getCurrentImage());
Constructor Summary | |
---|---|
GifImage(java.lang.String file)
Construct a new GifImage instance using the specified image file. |
Method Summary | |
---|---|
greenfoot.GreenfootImage |
getCurrentImage()
Get the current image in the animation sequence. |
java.util.List<greenfoot.GreenfootImage> |
getImages()
Get all the images used in the animation |
boolean |
isRunning()
Determines whether the animation is running |
void |
pause()
Pause the animation. |
void |
resume()
Resume the animation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GifImage(java.lang.String file)
Method Detail |
---|
public java.util.List<greenfoot.GreenfootImage> getImages()
public void pause()
public void resume()
public boolean isRunning()
public greenfoot.GreenfootImage getCurrentImage()