did you mean something like this?
/**
* Constructor for objects of class bg.
*
*/
public bg()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
setBackground("Screen Shot 2017-03-11 at 17.41.40.jpg");
}
because my background is still white despite having this code :(
The Greenfoot documentation is your friend (https://www.greenfoot.org/files/javadoc/):
"void scale(int width, int height)
Scales this image to a new size."
so you have to do something like:
GreenfootImage img = new GreenfootImage("Screen Shot 2017-03-11 at 17.41.40.jpg");
img.scale(width,height); <---- insert here your desired width and height or do img.scale(getWidth(),getHeight());
setBackground(img);