aboutsummaryrefslogtreecommitdiff
path: root/src/gui/Settings.java
blob: 94c2a89f98ee1ea034e53ce3adcfd3d66448e212 (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
package gui;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
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;

public class Settings extends Pane
{
    public Settings()
    {
        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) 
            {
                Driver.setBackground("assets/trees.png");
            }
        });

        Button exit = new Button();
        exit.setText("Exit");
        exit.setOnAction(e -> Driver.switchMenu("MainMenu"));

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