I have code to create text in the world but when it is created, it's invisible.
Code:
Thanks in advance!
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
import java.awt.Font;
/**
* Write a description of class PlainText here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class PlainText extends Actor
{
public PlainText(String text,int x,int y)
{
Font f = new Font("Times New Roman", Font.ITALIC, 11);
GreenfootImage gi= new GreenfootImage(300,300);
gi.setFont(f);
gi.setColor(Color.WHITE);
gi.drawString(text,x,y);
setImage(gi);
}
}


