This site requires JavaScript, please enable it in your browser!
Greenfoot back
-nic-
-nic- wrote ...

2012/4/11

gifimage

-nic- -nic-

2012/4/11

#
does the gifimage class create the gif for you and if so how would you do this Thanks:)
Duta Duta

2012/4/11

#
The GifImage class is simply so that you can have an actor which has an animated (.gif) image, it isn't for creating the .gif's in the first place. For that, try out this website.
-nic- -nic-

2012/4/11

#
thanks :)
-nic- -nic-

2012/4/12

#
ok i have no idear how to use the gifimage class can any one give some guidence i have my gifimage ready!!
-nic- -nic-

2012/4/12

#
ok i have no idear how to use the gifimage class can any one give some guidence i have my gifimage ready!!
nccb nccb

2012/4/12

#
If you just want a list of all the images in the GIF, you can do:
1
2
GifImage gif = new GifImage("myfile.gif");
List<GreenfootImage> allImages = gif.getImages();
Then you can use the list of images however you like. If you want to have it animate an actor's image using the timing in the GIF, you can make an actor along these lines:
1
2
3
4
5
6
7
8
9
class AnimatedActor extends Actor
{
    private GifImage gif = new GifImage("myfile.gif");
 
    public void act()
    {
        setImage(gif.getCurrentImage());
    }
}
-nic- -nic-

2012/4/12

#
thank nccb that works great:)
DSP512 DSP512

2014/1/19

#
how can i play the animation only once and then stop it?
You need to login to post a reply.