aboutsummaryrefslogtreecommitdiff
path: root/src/gui/DebugMenu.java
blob: 79545e9c9c0fbc9c56468b5439598fcf9dc616ff (plain) (blame)
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
package gui;

import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import main.Level;

public class DebugMenu 
{
    public Stage primaryStage = new Stage();

    /*
     * this class is a layout class, most of its purpose is to place UI elements like Buttons within Panes like VBoxes.
     * the creation of these UI elements are mostly not commented due to their repetitive and self explanatory nature.
     * style classes are defined in the style.css file.
     */
    VBox primaryPane = new VBox();
    public DebugMenu()
    {
        Button wallpaperTest = new Button();
        wallpaperTest.setText("wallpaper trees");
        wallpaperTest.setOnAction(e -> Driver.setBackground("assets/trees.png"));

        Button wallpaperTest2 = new Button();
        wallpaperTest2.setText("wallpaper water");
        wallpaperTest2.setOnAction(e -> Driver.setBackground("assets/water.png"));

        Button wallpaperTest3 = new Button();
        wallpaperTest3.setText("wallpaper pico");
        wallpaperTest3.setOnAction(e -> Driver.setBackground("assets/pico.png"));

        Button testfinish = new Button();
        testfinish.setText("launch game end");
        //create a sample level for testing
        Level temp = new Level();
        temp.title = "Title";
        temp.aritst = "artist";
        testfinish.setOnAction(e -> Driver.setMenu(new GameOver(temp, "Easy", new Settings(), 300)));

        primaryPane.getChildren().addAll(wallpaperTest,wallpaperTest2,wallpaperTest3,testfinish);
        
        Scene primaryScene = new Scene(primaryPane);
        primaryStage.setScene(primaryScene);
        primaryStage.setTitle("debug");
    }

    public void show()
    {
        primaryStage.show();
    }

    public void addButton(Button b)
    {
        primaryPane.getChildren().add(b);
    }
}