Hi, I've been looking to create a simple quiz game, but every time I input a color, it gives an error warning "No suitable constructor found for GreenfootImage(java.lang.String, int, greenfoot.Color)
Here is my class for the Question subclass in Actor.
Can you help explain in which part I am wrong?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Questions extends Actor { private boolean Continue = true ; private String text; public void act() { question1(); } public void question1() { java.awt.Color co = new java.awt.Color( 255 , 255 , 255 ); Color col = new Color( 255 , 255 , 255 ); GreenfootImage textImage = new GreenfootImage( "Bahasa Pemrograman Java merupakan turunan dari bahasa pemrograman: " , 4 , col); GreenfootImage image = new GreenfootImage(textImage.getWidth()+ 12 , 36 ); image.setColor( new Color( 255 , 255 , 255 )); image.fill(); image.setColor( new Color( 0 , 0 , 196 )); image.fillRect( 3 , 3 , image.getWidth()- 6 , 30 ); image.drawImage(textImage, 6 , 6 ); } } |