So i saw several posts about gifs and how to use them. However, whenever i attempt to replicate them my gif just wont work. My gif is a blinking cursor for typing. When im dragging it onto the world it is blinking, but as soon as i let go/or press play it just stays as a solid black line. Here's my code:
public class Cursor extends Actor
{
GifImage gif = new GifImage("Cursor.gif");
public Cursor()
{
int scalePercent = 25;
for (GreenfootImage image : gif.getImages())
{
int wide = image.getWidth()*scalePercent/100;
int high = image.getHeight()*scalePercent/100;
image.scale(wide, high);
}
}
/**
* Act - do whatever the Cursor wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
setImage(gif.getCurrentImage());
}
}
