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:
|
import ...
public class StartScene extends SceneStyle{
private Scene scene;
Button playBtn, chatBtn, highscoreBtn, optionsBtn, quitBtn;
VBox btnBox;
BorderPane borderPane;
HBox scoreBox;
public StartScene(){
scene.getStylesheets().add("/view/resources/styles.css");
playBtn = new Button("PLAY");
chatBtn = new Button("CHAT");
highscoreBtn = new Button("HIGHSCORE");
optionsBtn = new Button("OPTIONS");
quitBtn = new Button("QUIT");
//Buttonsstyling by setting an ID to the CSS file
playBtn.setId("button");
chatBtn.setId("button");
highscoreBtn.setId("button");
optionsBtn.setId("button");
quitBtn.setId("button");
//BORDER LEFT
btnBox = new VBox(playBtn, chatBtn, highscoreBtn, optionsBtn, quitBtn);
btnBox.setSpacing(10);
btnBox.setPadding(new Insets(20));
btnBox.setPrefSize(250, 400);
//BORDER BOTTOM
scoreBox = new HBox();
scoreBox.setPrefSize(200, 1100);
scoreBox.setPadding(new Insets(20, 0, 0, 250));
borderPane = new BorderPane();
setBorderPaneStyle(borderPane, btnBox, scoreBox);
this.scene = new Scene(borderPane, 1100, 650);
}
//(some other code)
}
|