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

2020/5/15

how do i use gifs?

Weeb2.exe Weeb2.exe

2020/5/15

#
as i stated above i cant get it to work this is my current code
public class Loading_screen extends World
{
    GifImage Loading = new GifImage("LoadingScreen.gif");
    /**
     * Constructor for objects of class Loading_screen.
     * 
     */
    public Loading_screen()
    {    
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(500, 500, 1); 
        prepare();
    }
    
    public void act()
    {
        Loading.getCurrentImage();
    }
    
    /**
     * Prepare the world for the start of the program.
     * That is: create the initial objects and add them to the world.
     */
    private void prepare()
    {
        
    }
}
danpost danpost

2020/5/15

#
Line 17 needs to invoke the setImage method.
Weeb2.exe Weeb2.exe

2020/5/16

#
like this?
setImage(Loading.getCurrentImage());
if so that doesn't work it tells me that it
cannot find symbol method setImage(greenfoot.GreenfootImage)
danpost danpost

2020/5/16

#
Weeb2.exe wrote...
<< Code Omitted >> that doesn't work it tells me that it
cannot find symbol method setImage(greenfoot.GreenfootImage)
Use "setBackground" (I did not notice it was in a World subclass).
Weeb2.exe Weeb2.exe

2020/5/17

#
danpost wrote...
Weeb2.exe wrote...
<< Code Omitted >> that doesn't work it tells me that it
cannot find symbol method setImage(greenfoot.GreenfootImage)
Use "setBackground" (I did not notice it was in a World subclass).
oh ok
Weeb2.exe Weeb2.exe

2020/5/17

#
it worked thank you
You need to login to post a reply.