TicTacToeMultiPlayer.fxml (5767B) download
1<?xml version="1.0" encoding="UTF-8"?>
2
3<?import com.jfoenix.controls.*?>
4<?import javafx.geometry.*?>
5<?import javafx.scene.control.*?>
6<?import javafx.scene.layout.*?>
7<?import java.lang.*?>
8
9<BorderPane stylesheets="@../../../css/theme.css" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="nl.isygameclient.controllers.games.tictactoe.TicTacToeMultiPlayerController">
10 <styleClass>
11 <String fx:value="surface" />
12 </styleClass>
13 <left>
14 <VBox prefWidth="200" spacing="20" styleClass="surface-variant">
15 <padding>
16 <Insets topRightBottomLeft="20" />
17 </padding>
18
19 <!-- Playing As Controls -->
20 <VBox>
21 <Label text="Playing As">
22 <styleClass>
23 <String fx:value="headline-small" />
24 <String fx:value="on-surface-variant-text" />
25 </styleClass>
26 </Label>
27 <Separator styleClass="on-surface-variant-text" />
28 <JFXComboBox fx:id="playingAsCombo" onAction="#onPlayingAsComboSelect" prefWidth="Infinity">
29 <styleClass>
30 <String fx:value="primary" />
31 -->
32 <String fx:value="on-primary-text" />
33 <String fx:value="body-large" />
34 </styleClass>
35 </JFXComboBox>
36 </VBox>
37 <VBox>
38 <Label text="Opponent">
39 <styleClass>
40 <String fx:value="headline-small" />
41 <String fx:value="on-surface-variant-text" />
42 </styleClass>
43 </Label>
44 <Separator styleClass="on-surface-variant-text" />
45 <Label fx:id="playingAgainstLabel" prefWidth="Infinity">
46 <styleClass>
47 <String fx:value="headline-small" />
48 <String fx:value="on-surface-variant-text" />
49 </styleClass>
50 </Label>
51 </VBox>
52 <VBox>
53 <children>
54 <Label text="Player">
55 <styleClass>
56 <String fx:value="headline-small" />
57 <String fx:value="on-surface-variant-text" />
58 </styleClass>
59 </Label>
60 <Separator styleClass="on-surface-variant-text" />
61 <TextField fx:id="nameField" promptText="Your Name" />
62 <TextField fx:id="opponentField" promptText="Opponent (optional)" />
63 </children>
64 </VBox>
65
66 <!-- Best of Controls -->
67 <VBox>
68 <Label text="Server">
69 <styleClass>
70 <String fx:value="headline-small" />
71 <String fx:value="on-surface-variant-text" />
72 </styleClass>
73 </Label>
74 <Separator styleClass="on-surface-variant-text" />
75 <HBox prefHeight="100.0" prefWidth="200.0">
76 <children>
77 <TextField fx:id="hostField" promptText="Host" />
78 <TextField fx:id="portField" alignment="CENTER_RIGHT" promptText="Port" text="7789" />
79 </children>
80 </HBox>
81 </VBox>
82
83 <!-- Window Controls -->
84 <Pane VBox.vgrow="ALWAYS" />
85 <VBox alignment="CENTER" spacing="10">
86 <JFXButton onAction="#onNewGameButtonClick" prefWidth="Infinity" text="New Game">
87 <styleClass>
88 <String fx:value="primary" />
89 <String fx:value="on-primary-text" />
90 <String fx:value="title-medium" />
91 </styleClass>
92 </JFXButton>
93 <JFXButton onAction="#onMainMenuButtonClick" prefWidth="Infinity" text="Main Menu">
94 <styleClass>
95 <String fx:value="primary" />
96 <String fx:value="on-primary-text" />
97 <String fx:value="title-medium" />
98 </styleClass>
99 </JFXButton>
100 <JFXButton onAction="#onExitButtonClick" prefWidth="Infinity" text="Exit">
101 <styleClass>
102 <String fx:value="primary" />
103 <String fx:value="on-primary-text" />
104 <String fx:value="title-medium" />
105 </styleClass>
106 </JFXButton>
107 </VBox>
108 </VBox>
109 </left>
110 <!-- Game Field -->
111 <center>
112 <HBox alignment="CENTER">
113 <padding>
114 <Insets topRightBottomLeft="20" />
115 </padding>
116
117 <!-- Left -->
118 <VBox alignment="TOP_CENTER" maxHeight="800" minWidth="150">
119 <Label text="Score Player">
120 <styleClass>
121 <String fx:value="headline-medium" />
122 <String fx:value="on-surface-text" />
123 </styleClass>
124 </Label>
125 <Label text="0">
126 <styleClass>
127 <String fx:value="headline-medium" />
128 <String fx:value="on-surface-text" />
129 </styleClass>
130 </Label>
131 <Separator maxWidth="100" />
132 </VBox>
133
134 <!-- Center -->
135 <VBox alignment="CENTER" minWidth="640">
136 <HBox alignment="CENTER">
137 <padding>
138 <Insets topRightBottomLeft="5" />
139 </padding>
140 <Label text="Current Player: ">
141 <styleClass>
142 <String fx:value="on-surface-text" />
143 <String fx:value="headline-small" />
144 </styleClass>
145 </Label>
146 <Label fx:id="currentPlayer">
147 <styleClass>
148 <String fx:value="on-surface-text" />
149 <String fx:value="headline-small" />
150 </styleClass>
151 </Label>
152 </HBox>
153 <Separator maxWidth="100" />
154
155 <StackPane>
156 <VBox.margin>
157 <Insets left="20" right="20" top="20" />
158 </VBox.margin>
159 <GridPane fx:id="grid" hgap="10" maxHeight="640" maxWidth="640" styleClass="ttt-grid" vgap="10">
160 <padding>
161 <Insets topRightBottomLeft="10" />
162 </padding>
163 </GridPane>
164 <Label fx:id="gameOverText" visible="false">
165 <padding>
166 <Insets bottom="10" left="20" right="20" top="10" />
167 </padding>
168 <styleClass>
169 <String fx:value="surface" />
170 <String fx:value="display-large" />
171 <String fx:value="on-surface-text" />
172 </styleClass>
173 </Label>
174 </StackPane>
175 </VBox>
176
177 <!-- Right -->
178 <VBox alignment="TOP_CENTER" maxHeight="800" minWidth="150">
179 <Label text="Score Opponent">
180 <styleClass>
181 <String fx:value="headline-medium" />
182 <String fx:value="on-surface-text" />
183 </styleClass>
184 </Label>
185 <Label text="0">
186 <styleClass>
187 <String fx:value="headline-medium" />
188 <String fx:value="on-surface-text" />
189 </styleClass>
190 </Label>
191 <Separator maxWidth="100" />
192 </VBox>
193 </HBox>
194 </center>
195</BorderPane>