-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEasterEgg.java
More file actions
52 lines (37 loc) · 1.44 KB
/
Copy pathEasterEgg.java
File metadata and controls
52 lines (37 loc) · 1.44 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
/* TAG: Team Adventure Game
* Code: Don Combs
* 11-24-2019 To Current Date
*
*/
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
public class EasterEgg {
public static void Egg() {
// TODO Auto-generated method stub
int width = 100;
int height = 30;
//BufferedImage image = ImageIO.read(new File("/Users/mkyong/Desktop/logo.jpg"));
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
g.setFont(new Font("SansSerif", Font.BOLD, 24));
Graphics2D graphics = (Graphics2D) g;
graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
graphics.drawString("TAG", 10, 20);
//save this image
//ImageIO.write(image, "png", new File("/users/mkyong/ascii-art.png"));
for (int y = 0; y < height; y++) {
StringBuilder sb = new StringBuilder();
for (int x = 0; x < width; x++) {
sb.append(image.getRGB(x, y) == -16777216 ? " " : "$");
}
if (sb.toString().trim().isEmpty()) {
continue;
}
System.out.println(sb);
}
//GameEngine.CurrentTown();
Town.CurrentTown();
}
}