I want to paint the World (Background) with 3 separate images. These images do not need to be able to drag or anything, they simply need to make up the background. Is there any way of doing this?
public Background()
{
super (/** dimensions of world */); // create world
GreenfootImage[] images =
{
new GreenfootImage("imageOne.jpg"), // adjust name of file as needed
new GreenfootImage("imageTwo.jpg"), // adjust name of file as needed
new GreenfootImage("imageThree.jpg") // adjust name of file as needed
}; // create the images
int x = 0; // starting x-coordinate for drawing images
for (int n=0; n<images.length; n++) // for each image
{
getBackground().drawImage(images[n], x, 0); // draw image on background
x += images[n].getWidth(); // set new x-coordinate for next image draw
}
}