I want my background image to be greenish under certain conditions. Here's my code (MyWorld class):
What it does is every act it draws a new translucent green layer on top of the background image, but doesn't remove the old one, so the background becomes completely green after a few acts.
Any ideas?
1 2 3 4 5 6 7 8 9 10 11 12 | public void greenBg() { GreenfootImage image = new GreenfootImage(getWidth(), getHeight()); int alpha = 50 ; Color color = new Color( 0 , 255 , 0 , alpha); image.setColor(color); image.fill(); getBackground().drawImage(image, 0 , 0 ); } |