-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathImageDisplay.java
More file actions
47 lines (42 loc) · 1.12 KB
/
Copy pathImageDisplay.java
File metadata and controls
47 lines (42 loc) · 1.12 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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class ImageDisplay here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class ImageDisplay extends Actor
{
private GreenfootImage image;
private static final Color transparent = new Color(0,0,0,0);
/**
* Description for constructor
* @param text desc parameters
* @param size
*/
public ImageDisplay(int text, int size)
{
image = new GreenfootImage(Integer.toString(text), size, Color.BLACK, transparent);
setImage(image);
}
/**
*
*/
public ImageDisplay(String text, int size)
{
image = new GreenfootImage(text, size, Color.BLACK, transparent);
setImage(image);
}
public ImageDisplay(String imageName)
{
image = new GreenfootImage(imageName);
image.scale(100,100);
setImage(image);
}
public ImageDisplay(String imageName, int x, int y)
{
image = new GreenfootImage(imageName);
image.scale(x,y);
setImage(image);
}
}