the object is strings value
here the code
Dialogue dialogue = new Dialogue("Press H for Howl");
addObject(dialogue,179,93); Dialogue dialogue = new Dialogue("Press H for Howl");
addObject(dialogue,179,93);import greenfoot.*;
public TempText extends Actor
{
private int timer;
public TempText(String text, int showActs)
{
timer = showActs;
setImage(new GreenfootImage(text, 28, Color.BLACK, new Color(0, 0, 0, 0)));
}
public void act()
{
if (--timer == 0) getWorld().removeObject(this);
|
|addObject(new TempText("Press H for Howl", 180), 179, 93);