This site requires JavaScript, please enable it in your browser!
Greenfoot back
堕天使
堕天使 wrote ...

2017/6/13

I found a bug and how do I use a transparent background to draw a String

堕天使 堕天使

2017/6/13

#
In the GreenfootImage javadoc, /** 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. */ but,if I pass the "null" this parameter will be throw a NullPointException.
Yehuda Yehuda

2017/6/13

#
In Greenfoot Version 3.1.0 passing null throws a NullPointerException even though it's not supposed to. For now create your own transparent color ('new Color(0, 0, 0, 0)').
You need to login to post a reply.