-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPauseWindow.java
More file actions
41 lines (31 loc) · 969 Bytes
/
PauseWindow.java
File metadata and controls
41 lines (31 loc) · 969 Bytes
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
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.scene.control.*;
import javafx.geometry.*;
public class PauseWindow {
public static void display(String title) {
Stage pauseWin = new Stage();
Button save, goBack;
pauseWin.initModality(Modality.APPLICATION_MODAL);
save = new Button();
save.setText("Save");
// save.setOnAction(e -> SAVE GAME PROGRESS);
goBack = new Button();
goBack.setText("Resume");
// This needs to return to the state of GamePlay at the time of
// selecting pause.
goBack.setOnAction(e -> GamePlay.display(title, "Things")); // < This is
// opening a
// new
// gamewindow,
// not
// returning.
VBox win = new VBox(25);
win.getChildren().addAll(save, goBack);
win.setAlignment(Pos.CENTER);
Scene pauseScene = new Scene(win);
pauseWin.setScene(pauseScene);
pauseWin.show();
}
}