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

2019/1/29

GIF frames overlap

AndreiTheMagic AndreiTheMagic

2019/1/29

#
I implemented GIF images in my knight class for running and staying idle, but the frames seem to overlap until the end of the loop instead of changing. Here is the code for the animation method I made for easy utilisation:
public void anim(GifImage gif)
    {
        setImage(gif.getCurrentImage());
    }
and here is the recording: https://youtu.be/Db9PNOrelzA
danpost danpost

2019/1/29

#
It is difficult to see what is going on without having the individual images of the gif image set you are using.
nccb nccb

2019/2/1

#
We did have a bug in the GifImage class which meant that certain GIFs did not clear their image properly between frames. This is fixed in Greenfoot 3.5.3 -- you'll need to install the new version, delete the GifImage class in your scenario, and re-add it via the Import Class functionality. That should hopefully fix the issue.
You need to login to post a reply.