aboutsummaryrefslogtreecommitdiff
path: root/src/gui/Settings.java
blob: ea5ce7eae273e847b122ef5e7fba2d495bb99655 (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
58
59
60
61
62
63
64
65
66
67
68
package gui;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Slider;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class Settings extends Scene
{
    private static Pane primaryPane = new Pane();

    public Settings(Stage primaryStage)
    {
        super(primaryPane, 800, 600);
        primaryStage.setTitle("NPE Hero - Settings");
        Scene root = super.getRoot().getScene();

        Text t1 = new Text();
        t1.setText("Music Volume");

        Slider musicVol = new Slider();
        musicVol.setMax(100);
        musicVol.setMin(0);

        Text t2 = new Text();
        t2.setText("Sound Effects Volume");

        Slider sfxVol = new Slider();
        sfxVol.setMax(100);
        sfxVol.setMin(0);

        Button devMenu = new Button();
        devMenu.setText("Debug Menu");
        devMenu.setOnAction(new EventHandler<ActionEvent>() 
        {
            @Override
            public void handle(ActionEvent event) 
            {
                System.out.println("not yet implimented");
            }
        });

        Button exit = new Button();
        exit.setText("Exit");
        exit.setOnAction(new EventHandler<ActionEvent>() 
        {
            @Override
            public void handle(ActionEvent event) 
            {
                primaryStage.setScene(root);
            }
        });

        VBox options = new VBox();
        options.setAlignment(Pos.CENTER);
        options.getChildren().addAll(t1,musicVol,t2,sfxVol,devMenu,exit);
        options.minWidthProperty().bind(primaryStage.widthProperty()); 
        options.minHeightProperty().bind(primaryStage.heightProperty());
        primaryPane.getChildren().add(options);
    }
    
}