setImage(new GreenfootImage(" Click here for dialog ", 30, Color.BLACK, Color.RED));
The constructor I referenced was the 'new GreenfootImage(String, int, Color, Color)' statement which 'constructs' a new GreenfootImage using the String 'text', the int 'fontSize', and the two Colors for the foreground and background.
Once the GreenfootImage object is constructed, it can be used in the 'setImage(GreenfootImage)' statement to set the image of your scoreboard object.
You will need to 'import java.awt.Color;' to make use of this constructor.
>toyttttt,
A constructor is the first method that is called in a class, when it is 'constructed'; i.e. created. I.E. a
new MyClass();
Would create a new class, for which java will look for a constructor method and call it if exists. A constructor class method happens to be the name of the class with no return parameters, for example:
public MyClass() {
//some initialisation or similar code
}
This code will execute on construction. You'll note that there is no return value between public and the method name; therefore indicating that this is a constructor. A constructor can have have parameters, for which the new MyClass(<params>) would have to be supplied.
I hope that makes sense.
Kind regards
sp33dy