-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMenu.java
34 lines (26 loc) · 1017 Bytes
/
Menu.java
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
import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.Graphics2D;
public class Menu{
public Rectangle playButton = new Rectangle(266, 150, 100, 50);
public Rectangle helpButton = new Rectangle(266, 250, 100, 50);
public Rectangle quitButton = new Rectangle(266, 350, 100, 50);
public void render(Graphics g)
{
Graphics2D g2d = (Graphics2D) g;
Font fnt0 = new Font("arial", Font.BOLD, 50);
g.setFont(fnt0);
g.setColor(Color.black);
g.drawString("Flash Cycle", 160, 100);
Font fnt1 = new Font("arial", Font.BOLD, 30);
g.setFont(fnt1);
g.drawString("Play", playButton.x + 15, playButton.y + 35);
g.drawString("Help", helpButton.x + 12, helpButton.y + 35);
g.drawString("Quit", quitButton.x + 13, quitButton.y + 35);
g2d.draw(playButton);
g2d.draw(helpButton);
g2d.draw(quitButton);
}
}