-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathText.java
More file actions
79 lines (66 loc) · 2.07 KB
/
Copy pathText.java
File metadata and controls
79 lines (66 loc) · 2.07 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Text here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Text extends Actor
{
private String content;
private int fontsize;
private Color fontColor;
private Color backColor;
private Color outlineColor;
private void setImage(){
GreenfootImage img = new GreenfootImage(content, fontsize, fontColor, backColor, outlineColor);
setImage(img);
}
public Text(String content){
content = "";
fontsize = 50;
fontColor = Color.BLUE;
backColor = Color.BLACK;
outlineColor = Color.GREEN;
}
public String getContent(){
return content;
}
public void setContent(String content2){
content = content2;
GreenfootImage img = new GreenfootImage(content, fontsize, fontColor, backColor, outlineColor);
setImage(img);
}
public int getSize(){
return fontsize;
}
public void setSize(int fontsize2){
fontsize = fontsize2;
GreenfootImage img = new GreenfootImage(content, fontsize, fontColor, backColor, outlineColor);
setImage(img);
}
public Color getfontColor(){
return fontColor;
}
public void setfontColor(Color fontColor2){
fontColor = fontColor2;
GreenfootImage img = new GreenfootImage(content, fontsize, fontColor, backColor, outlineColor);
setImage(img);
}
public Color getbackColor(){
return backColor;
}
public void setbackColor(Color backColor2){
backColor = backColor2;
GreenfootImage img = new GreenfootImage(content, fontsize, fontColor, backColor, outlineColor);
setImage(img);
}
public Color getoutlineColor(){
return outlineColor;
}
public void setoutlineColor(Color outlineColor2){
outlineColor = outlineColor2;
GreenfootImage img = new GreenfootImage(content, fontsize, fontColor, backColor, outlineColor);
setImage(img);
}
}