-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathText.java
More file actions
28 lines (26 loc) · 685 Bytes
/
Text.java
File metadata and controls
28 lines (26 loc) · 685 Bytes
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
28
import greenfoot.*;
import java.awt.Color;
/**
* Write a description of class Text here.
*
* @author (your name)
* @version (a version number or a date)
*/
public abstract class Text extends Actor
{
int delay;
// Constructor
public Text(String message, int sz, int dely) {
setImage(new GreenfootImage(message, sz, Color.WHITE, Color.BLACK));
this.delay = dely;
}
/**
* Act - do whatever the Text wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
Greenfoot.delay(this.delay);
getWorld().removeObject(this);
}
}