-
Notifications
You must be signed in to change notification settings - Fork 0
/
StartPane.java
62 lines (47 loc) · 1.66 KB
/
StartPane.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
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
import javafx.scene.layout.Pane;
import javafx.scene.text.*;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
/**
* Write a description of class DefaultPane here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class StartPane extends DefaultPane
{
private Text txtPrompt;
private Label lblInstructions;
private Button btnPlayNormal;
private Button btnPlayRush;
private Button btnPlaySmall;
public StartPane()
{
//INITIALIZE NODES
this.txtPrompt = new Text(50,50,"WELCOME TO THE GAME");
this.lblInstructions = new Label("This is how you play the game ayda yada ayda ay da");
this.btnPlayNormal = new Button("NORMAL");
this.btnPlayRush = new Button("RUSH");
this.btnPlaySmall = new Button("SMALL");
//SET BUTTON FUNCTIONALITY
this.btnPlayNormal.setOnAction(event -> {
super.changePane();
//tell gamemanger to start game and set mode
});
this.btnPlayRush.setOnAction(event -> {
super.changePane();
//tell gamemanger to start game and set mode
});
this.btnPlaySmall.setOnAction(event -> {
super.changePane();
//tell gamemanger to start game and set mode
});
//ADD ALL NODES TO PANE
this.getChildren().addAll(txtPrompt, lblInstructions, btnPlayNormal, btnPlayRush, btnPlaySmall);
System.out.println("hello");
}
public void setPrompt(String strPrompt)
{
this.txtPrompt.setText(strPrompt);
}
}