Hello,
I just updated to 3.1.0 and I noticed that the GreenfootImage class doesn't work as it did before although the class didn't change (or at least I don't see any difference in the API).
I use this constructor:
And this is the error:
public GreenfootImage(java.lang.String string, int size, Color foreground, Color background)
//...
foreground - the color of the text. Since Greenfoot 3.0.4, passing null will use black.
background - the color of the image behind the text. Since Greenfoot 3.0.4, passing null with leave the background transparent.
If 'foreground' and/or 'background' is 'null', it will give a NullPointer Exception. This did not happen before 3.1.0.
That's the code:
import greenfoot.*;
public class World1 extends World
{
public World1()
{
super(600, 400, 1);
GreenfootImage img = new GreenfootImage("text", 40, null, null);
}
}java.lang.NullPointerException at greenfoot.GreenfootImage.<init>(GreenfootImage.java:171) at World1.<init>(World1.java:8) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at greenfoot.core.Simulation.newInstance(Simulation.java:617) at greenfoot.platforms.ide.WorldHandlerDelegateIDE.lambda$instantiateNewWorld$7(WorldHandlerDelegateIDE.java:430) at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:502) at greenfoot.core.Simulation.maybePause(Simulation.java:305) at greenfoot.core.Simulation.runContent(Simulation.java:218) at greenfoot.core.Simulation.run(Simulation.java:211)


